scale icon indicating copy to clipboard operation
scale copied to clipboard

Close Data Grid menu in Modal triggers modal close

Open nikolab-pn opened this issue 2 years ago • 1 comments

Scale Version @telekom/scale-components 3.0.0-beta.106

Framework and version @telekom/scale-components-react 3.0.0-beta.106

Current Behavior Closing menu (sort/visibility) on Data Grid triggers Modal close when Data Grid is inside modal

Expected Behavior Closing menu (sort/visibility) on Data Grid should not trigger Modal close when Data Grid is inside modal

Code Reproduction https://codesandbox.io/s/agitated-gianmarco-w5mmjw?file=/src/App.js:524-536

Steps:

  1. Click button to open modal
  2. Open Data Grid menu
  3. Click outside of Dat Grid menu to close it
  4. onScale-close is triggred

Desktop (please complete the following information):

  • OS: macOS 12.3.6
  • Browser: Chrome
  • Version: 105.0.5195.102

nikolab-pn avatar Sep 15 '22 08:09 nikolab-pn

@felix-ico https://github.com/telekom/scale/issues/1169 👀

acstll avatar Sep 22 '22 15:09 acstll

Hi @nikolab-pn, thanks for opening the issue. I forked your sandbox here https://codesandbox.io/s/prod-snowflake-559h4z?file=/src/App.js, hope it helps. We will update the documentation to clarify this behavior, as the question has come up before.

felix-ico avatar Sep 26 '22 15:09 felix-ico

Hi @felix-ico, thank you for the fix, I have already implemented something simmilar. Will there be a fix for this and simmilar issues like #1169 ?

nikolab-pn avatar Sep 27 '22 06:09 nikolab-pn

Hi @nikolab-pn we discussed in the team whether we should implement prefixed events to prevent something like this but decided against that (for now) as it would be a big breaking change for lots of users. We will instead try to clarify this in the documentation.

felix-ico avatar Sep 27 '22 16:09 felix-ico