Skip to content

Commit

Permalink
[Modals]: autofocus first active element on modal open. It's a tempor…
Browse files Browse the repository at this point in the history
…ary fix, because of bug in react-focus-lock lib(theKashey/react-focus-lock#340). Ideally focus should move to the first active element only after 'Tab' key was pressed, we will come back to this solution when bug will be fixed.
  • Loading branch information
AlekseyManetov committed Dec 9, 2024
1 parent 72c88fc commit 43018d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* [RTE]: fixed error while merging cells without content
* [RTE]: fixed bug when files added from attachment button inserted in preview mode instead of attachment block
* [RTE]: fixed crash when removing the sole table row
* [Modals]: autofocus first active element on modal open. It's a temporary fix, because of bug in react-focus-lock lib(https://github.com/theKashey/react-focus-lock/issues/340). Ideally focus should move to the first active element only after 'Tab' key was pressed, we will come back to this solution when bug will be fixed.

# 5.11.0 - 15.11.2024

Expand Down
2 changes: 1 addition & 1 deletion uui-components/src/overlays/ModalBlocker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const ModalBlocker = React.forwardRef<HTMLDivElement, ModalBlockerProps>(
onClick={ handleBlockerClick }
aria-label="Click to close a modal"
/>
<FocusLock autoFocus={ false } returnFocus={ { preventScroll: true } } disabled={ props.disableFocusLock }>
<FocusLock autoFocus={ true } returnFocus={ { preventScroll: true } } disabled={ props.disableFocusLock }>
{props.children}
</FocusLock>
</div>
Expand Down

0 comments on commit 43018d3

Please sign in to comment.