Skip to content

Commit

Permalink
Revised element IDs within the Popver section of src/docs to use IDs …
Browse files Browse the repository at this point in the history
…generated by the htmlIdGenerator utility function
  • Loading branch information
Brianna Hall authored and Brianna Hall committed Aug 30, 2021
1 parent d1aa8ae commit 5d763bf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src-docs/src/views/popover/trap_focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ import {
EuiSwitch,
} from '../../../../src/components';

import { htmlIdGenerator } from '../../../../src/services';

export default () => {
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
const formRowID__1 = htmlIdGenerator('formrow')();
const formRowID__2 = htmlIdGenerator('formrow')();

const onButtonClick = () =>
setIsPopoverOpen((isPopoverOpen) => !isPopoverOpen);
Expand All @@ -27,10 +31,10 @@ export default () => {
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
initialFocus="[id=asdf2]">
initalFocus={`[id=${formRowID__2}]`}>
<EuiFormRow
label="Generate a public snapshot?"
id="asdf"
id={formRowID__1}
hasChildLabel={false}>
<EuiSwitch
name="switch"
Expand All @@ -40,7 +44,7 @@ export default () => {
/>
</EuiFormRow>

<EuiFormRow label="Include the following in the embed" id="asdf2">
<EuiFormRow label="Include the following in the embed" id={formRowID__2}>
<EuiSwitch
name="switch"
label="Current time range"
Expand Down

0 comments on commit 5d763bf

Please sign in to comment.