-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modal component properties is not clearing when reusing the component #21
Comments
Hi, @Nks! Thank you for raising this important issue!
I really don't wanna make breaking changes, and I want to help you. For the global solution, we can think about adding a new method to dialog instance
Or we can make method |
Ok, an alternative solution with backward compatibility. You can set
By default, I will set all options to |
@Nks Fix is on the way: props-fix! You can fix your issue by using it like that:
Options are optional, so if you don't use them, the dialog's props will behave like previously. |
Hey @harmyderoman. Thank you for looking at this! Yes, I think additional parameters should work fine. As I said - the temporary solution is to init the dialog whenever we want to show the dialog works too. I'll check the suggested solution this week. Thank you again! |
Fixed by #22 |
Version: 0.4.3
Problem
When defining the component, using it for different states, and passing the props to the component with different values, it is not using a new component.
How to reproduce
Define the modal one time and reuse it for different states:
useAlert.ts
alerts.vue
Alert.vue
CleanShot.2022-10-27.at.18.04.46.mp4
Possible solution
When executing the
reveal
method, it should re-init the children component with new properties - in this case, it will clear the properties passed before.Temporary solution
Init the component every time with
const alertModal = createConfirmDialog(Alert);
The text was updated successfully, but these errors were encountered: