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

No initial focus

Open EldRoos opened this issue 6 years ago • 3 comments
trafficstars

How do I use focus lock and having no input focused from start?

EldRoos avatar Nov 13 '19 14:11 EldRoos

set autoFocus prop to false. It will suppress any active focus outside the lock, but not move it inside.

theKashey avatar Nov 13 '19 21:11 theKashey

I tried that, and still the first input within FocusLock element get focused.

Also: componentDidMount() { document.activeElement.blur(); } dosen't do anything.

EldRoos avatar Nov 14 '19 07:11 EldRoos

Check persistentFocus(default false) prop then - it will enforce something to be focused in any case.

theKashey avatar Nov 14 '19 10:11 theKashey

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 Apr 30 '23 12:04 stale[bot]