seas-computing / mark-one

A UI component library for building React Apps (in development)
https://seas-computing.github.io/mark-one/
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Bug fix: Modal Closing Behavior #136

Closed natalynyu closed 1 year ago

natalynyu commented 1 year ago

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

Checklist:

Priority:

Related Issues:

Fixes #538