Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Jul 5, 2023
1 parent cab5d55 commit 09d836d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src-docs/src/views/focus_trap/focus_trap_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const FocusTrapExample = {
},
],
text: (
<React.Fragment>
<>
<p>
Use <strong>EuiFocusTrap</strong> to prevent keyboard-initiated
focus from leaving a defined area. Temporary flows and UX escapes
Expand All @@ -37,15 +37,21 @@ export const FocusTrapExample = {
<strong>EuiFocusTrap</strong> will maintain the tab order expected
by users.
</p>
<p>
Use <EuiCode>clickOutsideDisables</EuiCode> to disable the focus
trap when the user clicks outside the trap.
</p>
<p>
Use <EuiCode>noIsolation=false</EuiCode> when pointer events on
outside elements should be disallowed.
</p>
</React.Fragment>
<ul>
<li>
Use <EuiCode>clickOutsideDisables</EuiCode> to disable the focus
trap when the user clicks outside the trap.
</li>
<li>
Use <EuiCode>noIsolation=false</EuiCode> when pointer events on
outside elements should be disallowed.
</li>
<li>
Use <EuiCode>crossFrame=true</EuiCode> when focus should not be
allowed on other iframes on the page.
</li>
</ul>
</>
),
props: { EuiFocusTrap },
demo: <FocusTrap />,
Expand Down
1 change: 1 addition & 0 deletions src/components/focus_trap/focus_trap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class EuiFocusTrap extends Component<EuiFocusTrapProps, State> {
returnFocus: true,
noIsolation: true,
scrollLock: false,
crossFrame: false,
gapMode: 'padding', // EUI defaults to padding because Kibana's body/layout CSS ignores `margin`
};

Expand Down

0 comments on commit 09d836d

Please sign in to comment.