davidtheclark/react-aria-modal

Click on underlay closes multiple modals

Open

#88 创建于 2019年4月24日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)JavaScript (94 fork)github user discovery
enhancementhelp wanted

仓库指标

Star
 (1,039 star)
PR 合并指标
 (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.

贡献者指南