mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Avoid beta badge focus when word count modal is opened (#30281)
GitOrigin-RevId: 570002a4dade41d393c66508e36c2863840f57f6
This commit is contained in:
@@ -17,6 +17,7 @@ const WordCountModal = memo(function WordCountModal({
|
||||
onHide={handleHide}
|
||||
id="word-count-modal"
|
||||
data-testid="word-count-modal"
|
||||
initialFocus={false}
|
||||
>
|
||||
<WordCountModalContent handleHide={handleHide} />
|
||||
</OLModal>
|
||||
|
||||
@@ -16,7 +16,10 @@ type OLModalProps = ModalProps & {
|
||||
show?: boolean
|
||||
} & Pick<
|
||||
FocusTrapOptions,
|
||||
'escapeDeactivates' | 'clickOutsideDeactivates' | 'returnFocusOnDeactivate'
|
||||
| 'escapeDeactivates'
|
||||
| 'clickOutsideDeactivates'
|
||||
| 'returnFocusOnDeactivate'
|
||||
| 'initialFocus'
|
||||
>
|
||||
|
||||
type OLModalHeaderProps = ModalHeaderProps & {
|
||||
@@ -30,6 +33,7 @@ export function OLModal({
|
||||
returnFocusOnDeactivate = true, // Return focus to trigger element when modal closes
|
||||
escapeDeactivates = false, // Let React-Bootstrap Modal handle Escape key to avoid double Escape key handling
|
||||
clickOutsideDeactivates = true, // Allow focus trap to deactivate on outside click and let React-Bootstrap Modal handle it
|
||||
initialFocus,
|
||||
...props
|
||||
}: OLModalProps) {
|
||||
return (
|
||||
@@ -40,6 +44,7 @@ export function OLModal({
|
||||
escapeDeactivates,
|
||||
clickOutsideDeactivates,
|
||||
returnFocusOnDeactivate,
|
||||
initialFocus,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user