davidtheclark/react-aria-modal

Click on underlay closes multiple modals

開放

#88 建立於 2019年4月24日

 (4 則留言) (0 個反應) (0 位負責人)JavaScript (94 個分叉)github user discovery
enhancementhelp wanted

倉庫指標

星標
 (1,039 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

When underlayClickExits is true, clicking on the underlay around a modal will close the modal. This works perfectly when there's a single modal.

On the other hand, this works a little unexpectedly when there are multiple modals. In that case, if you have a modal and create a second modal and they both have underlayClickExits set to true, one would expect only the second modal to close when you click the underlay. If you click the underlay though in an area outside of both modals, then BOTH modals will close. I don't think this is the expected behavior.

Ideally, I think the modals should know when they're NOT the top most modal and add that being the top most modal as a condition in the checkUnderlayClick function.

I don't know if such a change would be backwards compatible but it's a feature I would find useful.

貢獻者指南