-
Notifications
You must be signed in to change notification settings - Fork 500
"Copy to Clipboard" icon does not work inside a bootstrap modal container #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
thanks for reporting the issue! I'll try to replicate as soon as I have a chance. |
@MrLeebo would you mind testing with |
@mac-s-g Thanks, but it doesn't seem to have made a difference. |
@mac-s-g Thanks for such an awesome project! I am experiencing the same issue. Happy to help if possible. |
updating title because I was able to use copy-to-clipboard when using a semantic-ui modal rather than bootstrap. I'll dig in to bootstrap a bit. |
also verified that the issue does occur when using a react-bootstrap modal at version 0.31.5 |
relevant threads:
here is the only solution I can find: I hope that helps. I'm closing this issue because I don't think the problem is caused by RJV source. It's a documented issue with bootstrap modals. |
It is well known that there are issues with copying to the clipboard inside of a Bootstrap modal: mac-s-g/react-json-view#131 After briefly trying some of the suggestions in the above link with no success, I decided to temporarily disable this desirable feature until we can find something that works.
I've found similar issue when using
|
Inside a Mui model adding <Modal disableEnforceFocus> |
## Describe your changes Closes #9112 Right now, copy buttons in dialogs don't work. This seems to be because the Modal swallows the focus events. This PR fixes this by using the `container` property from `ClipboardJS` (inspiration from [here](mac-s-g/react-json-view#131 (comment))). This is now also used in our `ReactJSON` element. In the first iteration we set `focusLock={false}` on the Dialog which also solved this issue. However, that came with an accessibility drawback where you would be able to select elements outside of the container via the `Tab` key. ## GitHub Issue Link (if applicable) ## Testing Plan - Explanation of why no additional tests are needed - Unit Tests (JS and/or Python) - E2E Tests - Add an e2e test to ensure that copying works - Any manual testing needed? --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
@vaclav-purchart suggestion worked for me! (same issue- copy not working within an MUI Dialog) 👍 |
## Describe your changes Closes streamlit#9112 Right now, copy buttons in dialogs don't work. This seems to be because the Modal swallows the focus events. This PR fixes this by using the `container` property from `ClipboardJS` (inspiration from [here](mac-s-g/react-json-view#131 (comment))). This is now also used in our `ReactJSON` element. In the first iteration we set `focusLock={false}` on the Dialog which also solved this issue. However, that came with an accessibility drawback where you would be able to select elements outside of the container via the `Tab` key. ## GitHub Issue Link (if applicable) ## Testing Plan - Explanation of why no additional tests are needed - Unit Tests (JS and/or Python) - E2E Tests - Add an e2e test to ensure that copying works - Any manual testing needed? --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
## Describe your changes Closes streamlit#9112 Right now, copy buttons in dialogs don't work. This seems to be because the Modal swallows the focus events. This PR fixes this by using the `container` property from `ClipboardJS` (inspiration from [here](mac-s-g/react-json-view#131 (comment))). This is now also used in our `ReactJSON` element. In the first iteration we set `focusLock={false}` on the Dialog which also solved this issue. However, that came with an accessibility drawback where you would be able to select elements outside of the container via the `Tab` key. ## GitHub Issue Link (if applicable) ## Testing Plan - Explanation of why no additional tests are needed - Unit Tests (JS and/or Python) - E2E Tests - Add an e2e test to ensure that copying works - Any manual testing needed? --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
I built a repro using https://esnextb.in/ but it seems that the site's Save function is currently broken.
Repro: https://gist.github.com/MrLeebo/84a3059a7a33993c34567172ec77698f
The text was updated successfully, but these errors were encountered: