react-focus-lock icon indicating copy to clipboard operation
react-focus-lock copied to clipboard

[Shadow root][Iframe] The text should be selectable inside <FocusLock/>

Open JuliaMV opened this issue 7 months ago • 3 comments

The content of FocusLock that opened inside of shadow root or iframe is not available for user-selection.

How to reproduce:

  1. Open the demo sandbox (with iframe) https://codesandbox.io/p/devbox/focus-lock-with-modal-forked-vmr9sl?workspaceId=ws_BCJDEdyBHvVP9ekjRYa7KV
  2. Click "Open modal" button
  3. Try select some text to copy it

https://github.com/user-attachments/assets/fb32d6c3-aaf1-4e85-a138-8e99f67700cf

JuliaMV avatar Mar 26 '25 08:03 JuliaMV

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?

pereira-renan avatar May 08 '25 20:05 pereira-renan

"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

theKashey avatar May 18 '25 03:05 theKashey

the updated link to the sandbox - https://codesandbox.io/p/live/2d37796c-134c-41e5-ad4a-bfe70f21d5fb

JuliaMV avatar May 19 '25 13:05 JuliaMV

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.

stale[bot] avatar Jul 18 '25 14:07 stale[bot]