scale
scale copied to clipboard
Close Data Grid menu in Modal triggers modal close
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:
- Click button to open modal
- Open Data Grid menu
- Click outside of Dat Grid menu to close it
- onScale-close is triggred
Desktop (please complete the following information):
- OS: macOS 12.3.6
- Browser: Chrome
- Version: 105.0.5195.102
@felix-ico https://github.com/telekom/scale/issues/1169 👀
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.
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 ?
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.