theKashey / react-focus-lock

It is a trap! A lock for a Focus. 🔓
MIT License
1.27k stars 67 forks source link

Set crossFrame as false by default #218

Closed yevhenii-username closed 1 year ago

yevhenii-username commented 2 years ago

crossFrame the default should be false, as it's surprising this behavior is even possible in the browser. You can spend a lot of time trying find issues which related to lost focus on inputs in main windows. And after a few days you find that some of dependencies of the project which run inside the iframe use react-focus-lock whithout crossFrame param (just because it's non-obvious)

https://github.com/theKashey/react-focus-lock/issues/104#issuecomment-734332075 comment

theKashey commented 2 years ago

I cannot change default value of this properly without changing major version as it could be a breaking change.

Instead I would propose the "actual fix" for the problem and make this behavior observable, obvious and no longer surprising.

yevhenii-username commented 2 years ago

But in my case, it not working properly. As you can see, all things inside the iframe (right side) working properly, but if you go to the main window there is issues with input focus, also all hovers working

https://user-images.githubusercontent.com/17275749/170856751-2d5a72f2-b8d5-4c41-bffb-26fee37f7569.mov

This modal inside FocusLock componen Screenshot 2022-05-29 at 10 17 06

stale[bot] commented 1 year ago

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.