mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01: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}
|
onHide={handleHide}
|
||||||
id="word-count-modal"
|
id="word-count-modal"
|
||||||
data-testid="word-count-modal"
|
data-testid="word-count-modal"
|
||||||
|
initialFocus={false}
|
||||||
>
|
>
|
||||||
<WordCountModalContent handleHide={handleHide} />
|
<WordCountModalContent handleHide={handleHide} />
|
||||||
</OLModal>
|
</OLModal>
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ type OLModalProps = ModalProps & {
|
|||||||
show?: boolean
|
show?: boolean
|
||||||
} & Pick<
|
} & Pick<
|
||||||
FocusTrapOptions,
|
FocusTrapOptions,
|
||||||
'escapeDeactivates' | 'clickOutsideDeactivates' | 'returnFocusOnDeactivate'
|
| 'escapeDeactivates'
|
||||||
|
| 'clickOutsideDeactivates'
|
||||||
|
| 'returnFocusOnDeactivate'
|
||||||
|
| 'initialFocus'
|
||||||
>
|
>
|
||||||
|
|
||||||
type OLModalHeaderProps = ModalHeaderProps & {
|
type OLModalHeaderProps = ModalHeaderProps & {
|
||||||
@@ -30,6 +33,7 @@ export function OLModal({
|
|||||||
returnFocusOnDeactivate = true, // Return focus to trigger element when modal closes
|
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
|
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
|
clickOutsideDeactivates = true, // Allow focus trap to deactivate on outside click and let React-Bootstrap Modal handle it
|
||||||
|
initialFocus,
|
||||||
...props
|
...props
|
||||||
}: OLModalProps) {
|
}: OLModalProps) {
|
||||||
return (
|
return (
|
||||||
@@ -40,6 +44,7 @@ export function OLModal({
|
|||||||
escapeDeactivates,
|
escapeDeactivates,
|
||||||
clickOutsideDeactivates,
|
clickOutsideDeactivates,
|
||||||
returnFocusOnDeactivate,
|
returnFocusOnDeactivate,
|
||||||
|
initialFocus,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
Reference in New Issue
Block a user