Skip to content
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

Overlay always dismisses modal #106

Closed
2 tasks
hmcq6 opened this issue Dec 17, 2015 · 2 comments
Closed
2 tasks

Overlay always dismisses modal #106

hmcq6 opened this issue Dec 17, 2015 · 2 comments

Comments

@hmcq6
Copy link
Contributor

hmcq6 commented Dec 17, 2015

I want to make a modal with an overlay where clicking the overlay does not dismiss the modal. We use it as a way to confirm that a user is agreeing to some piece of information. The only way to dismiss the modal should be to click the big green button.

I also consider it to be inconsistent behavior that a modal with an overlay is dismissible by clicking outside the modal (on the overlay) despite the fact that clickOutsideToClose is false. If clickOutsideToClose is only relevant when you don't have an overlay then it should have a more specific name, like clickEmberModalDialogToClose or clickContainerToClose.

I suggest we remedy both situations by having clickOutsideToClose disable clicking the overlay to close. Making the behavior for clicking outside of the modal consistent whether the modal has an overlay or not.

If its decided that clickOutsideToClose should not be used to control clicking on the overlay then I suggest/request adding a new flag such as clickOverlayToClose.

I'm working on a PR to:

  • add a new close action called clickOverlayToClose that will call the close action if clickOutsideToClose is true
  • have the default template use clickOverlayToClose action instead of the default close action
@raycohen
Copy link
Contributor

I don't think we need a new flag. Adding the behavior you wanted the existing flag to provide seems reasonable.

You're using clickOverlayToClose as both a flag name and an action name. I think the action that the template uses should become clickedOverlay and based on the value of the clickOutsideToClose flag it should either do nothing or send the close action.

@lukemelia
Copy link
Contributor

This should be possible now. Let me know if it's not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants