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

Modal is closed when the click event is started inside the modal and ended on overlay #289

Open
rnuyts opened this issue Oct 11, 2019 · 6 comments

Comments

@rnuyts
Copy link

rnuyts commented Oct 11, 2019

In our Ember application, we use ember-modal-dialog. Inside one of the modals, we have a slider control.
If the user starts to click in the modal content and ends the click on the overlay, it closes the modal.

When I try the same operation in the examples (here : http://yapplabs.github.io/ember-modal-dialog/) it does the same.

Is there a solution to make it working like the Boostrap modals ? When the mousedown is triggered inside the modal and the mouseup is triggered on the overaly, the modal is not closed. If you want to close the modal, you have to do the mousedown and the mouseup on the overlay.

Is there a workaround to fix this behavior ?

Thank you in advance for your help

@rnuyts rnuyts changed the title Modal is closed when the click event is started inside the modal and ending on overlay Modal is closed when the click event is started inside the modal and ended on overlay Oct 11, 2019
@spolloni
Copy link

would love to have a fix or workaround for this behavior as well.

@loxmys
Copy link

loxmys commented Dec 23, 2019

@remiuz, @spolloni You can use overlayPosition="sibling" for fix this

@rnuyts
Copy link
Author

rnuyts commented Mar 20, 2020

@remiuz, @spolloni You can use overlayPosition="sibling" for fix this

Hi @loxmys, we tried the overlayPosition="sibling"and it fixed the problem of drag and drop. The problem is that we use sometimes two stacked modals and setting the overlayPosition to sibling seems to break the stack-ability of the modals.

overlayPosition="parent" :
Screenshot from 2020-03-20 09-55-38

overlayPosition="sibling" :
Screenshot from 2020-03-20 09-56-00

Any idea if there is a solution to make it working with the "sibling" as overlay position ?

@vfuto
Copy link

vfuto commented Mar 21, 2020

You shouldn't use nested modals (modal in modal).

In the Bootstrap docs, it says

Bootstrap only supports one modal window at a time. Nested modals aren’t supported as we believe them to be poor user experiences.

The solution should be swapping out the modals in the view: closing child modal will open back up parent vice versa.

@MariannaAtPlay
Copy link

overlayPosition="sibling"

We are running into this issue as well. I tried the suggested workaround, but it didn't make a difference. Are there any plans to fix this issue?

@rtablada
Copy link

rtablada commented Jan 6, 2022

Using overlay position does prevent the closing (depending on some CSS hierarchy) though it seems like there should be a better native event listener to make sure that this is happening.

I tried to modify the actions to see if there was a quick work around by extending the component. I think that it is likely that to fix this there may need to be explicit listeners for mousedown and mouseup to determine if the click began on the modal and ended on the overlay.

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

6 participants