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
fix(modal): add DDAU for modal visibility #140
Conversation
@@ -4,6 +4,8 @@ | |||
{{#uk-modal | |||
visible=visible | |||
on-submit=(action "submit") | |||
on-show=(action (mut visible) true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on-hide
makes sense to me because of DDAU, but on-show
looks super unnecessary: The "hide" event can be triggered from the modal, but the "show" event can't. I'd say the default implementation for show should remain in the component, and on-show
would then be an extremely optional hook that we'd probably need only for very special use cases.
The public API would then be:
{{#uk-modal
visible=visible # component reacts to outside state of "visible"
on-hide=(...)
}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, the modal can still be opened via a button. For that case we should have the possibility to update our toggle variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. But let's not force the user to specify on-show
, because with the documented usage it's redundant.
@anehx I think we shouldn't force our users to implement Currently, the modal won't open if one doesn't implement it. |
@czosel Did you test that? Works fine in my test environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I got quite confused about the visible
property - i was thinking that on-show
is a mandatory argument now. All good 👍
## [0.8.1](v0.8.0...v0.8.1) (2019-06-11) ### Bug Fixes * **deps:** update dependencies and drop ember-cli-eslint ([1a6023d](1a6023d)) * **deps:** update ember source ([3d293ba](3d293ba)) * **modal:** add DDAU for modal visibility ([#140](#140)) ([6a3ddef](6a3ddef)) * **modal:** reintroduce option for close button ([8a719e9](8a719e9)) * **notification:** wrong property in snippet ([f925d47](f925d47)) * **syntax:** use the new template syntax ([142aa3a](142aa3a)) * **tests:** fix wrong attribute in uk-toggle-switch test ([73be406](73be406))
## [0.8.2](v0.8.1...v0.8.2) (2019-06-11) ### Bug Fixes * **deps:** update dependencies and drop ember-cli-eslint ([1a6023d](1a6023d)) * **deps:** update ember source ([3d293ba](3d293ba)) * **modal:** add DDAU for modal visibility ([#140](#140)) ([6a3ddef](6a3ddef)) * **notification:** wrong property in snippet ([f925d47](f925d47)) * **syntax:** use the new template syntax ([142aa3a](142aa3a)) * **tests:** fix wrong attribute in uk-toggle-switch test ([73be406](73be406))
🎉 This PR is included in version 0.8.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.