This PR updates the Modal component such that the modal does not close when there is a mouseDown event on the modal and a mouseUp event on the modal backdrop. The closeHandler is only called when the mouseDown and mouseUp event both occur on the backdrop.
Previously, event.stopPropagation was being called when there was an onClick event on the modal. In the case where there was only a mouseDown on the modal, the propagation was not being stopped from bubbling up to the backdrop, so when the mouseUp event happened on the backdrop, it seems that it was as if a full click event happened on the backdrop.
Describe your changes
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality
to change)
Checklist:
[x] I have run eslint on the code
[x] I have added JSDoc for all of my code (where applicable)
This PR updates the
Modal
component such that the modal does not close when there is amouseDown
event on the modal and amouseUp
event on the modal backdrop. ThecloseHandler
is only called when themouseDown
andmouseUp
event both occur on the backdrop.Previously,
event.stopPropagation
was being called when there was anonClick
event on the modal. In the case where there was only amouseDown
on the modal, the propagation was not being stopped from bubbling up to the backdrop, so when themouseUp
event happened on the backdrop, it seems that it was as if a full click event happened on the backdrop.Describe your changes
Types of changes
Checklist:
eslint
on the codePriority:
Related Issues:
Fixes #538