theKashey / react-focus-on

🎯 Solution for WAI ARIA compatible modal dialogs or full-screen tasks, you were looking for
MIT License
333 stars 14 forks source link

Support passing `focusOptions` to `react-focus-lock` #62

Closed cee-chen closed 1 year ago

cee-chen commented 1 year ago

As of 2.7.0, react-focus-lock has supported a focusOptions prop, primarily for allowing consumers to pass preventScroll to the initial focus event. react-focus-on unfortunately has not exposed nor is passing that prop directly to react-focus-lock, which potentially leads to scroll jumping issues that cannot be overridden (see https://github.com/theKashey/react-focus-lock/issues/162 for more info).

It should be relatively trivial to pull focusOptions from props and pass it directly to <ReactFocusLock> here: https://github.com/theKashey/react-focus-on/blob/master/src/UI.tsx#L49