react-focus-lock
react-focus-lock copied to clipboard
[Shadow root][Iframe] The text should be selectable inside <FocusLock/>
The content of FocusLock that opened inside of shadow root or iframe is not available for user-selection.
How to reproduce:
- Open the demo sandbox (with iframe) https://codesandbox.io/p/devbox/focus-lock-with-modal-forked-vmr9sl?workspaceId=ws_BCJDEdyBHvVP9ekjRYa7KV
- Click "Open modal" button
- Try select some text to copy it
https://github.com/user-attachments/assets/fb32d6c3-aaf1-4e85-a138-8e99f67700cf
Hi JuliaMV,
I have a similar issue, but we are not using iframe; we are using shadow DOM and web components. However, I can't reproduce it in a code sandbox environment.
I cannot access the URL you provided. Could you share that again to see if I can reproduce my issue too?
"DevBox is not available" 😿
In any case problem seems to be related to #335 and I reckon the problem is this line - https://github.com/theKashey/react-focus-lock/blob/master/src/Trap.js#L138
the updated link to the sandbox - https://codesandbox.io/p/live/2d37796c-134c-41e5-ad4a-bfe70f21d5fb
This issue has been marked as "stale" because there has been no activity for 2 months. If you have any new information or would like to continue the discussion, please feel free to do so. If this issue got buried among other tasks, maybe this message will reignite the conversation. Otherwise, this issue will be closed in 7 days. Thank you for your contributions so far.