canonical / canonical/react-components

`ContextualMenu`: outside click should be ignored if there is a modal open

Open
#1,049 3 comments 0 reactions 0 assignees View on GitHub
Bug 🐛 P3 Triaged Triaged: v4
Dominant language
TypeScript
Stars
151
Forks
74
Avg merge
1d 2h
Merged PRs (30d)
11

Description

When the `closeOnOutsideClick` prop of the `ContextualMenu` is `true`, it should be explicitly checked that there is no modal open before closing the contextual menu on outside click.

This is because, with the current behaviour, a click inside the modal would be captured as outside click for the `ContextualMenu`, causing that to be closed, and since the modal can be a direct child of that `ContextualMenu`, it would end up being removed as well. See the problem more clearly in the following screen capture:

![Peek 2024-02-29 23-42](https://github.com/canonical/react-components/assets/56583786/1237ebb8-c239-4dc7-ade5-263163936be6)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.