Skip to content

Commit

Permalink
Revised element IDs within the Form Layouts section of src/docs to us…
Browse files Browse the repository at this point in the history
…e IDs generated by the htmlIdGenerator utility function
  • Loading branch information
Brianna Hall authored and Brianna Hall committed Aug 30, 2021
1 parent dc07184 commit 7000dd7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src-docs/src/views/form_layouts/inline_popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export default () => {
const [isPopover2Open, setIsPopover2Open] = useState(false);
const [isSwitchChecked, setIsSwitchChecked] = useState(true);

const switchID = htmlIdGenerator('switch')();
const popoverID__1 = htmlIdGenerator('popover')();
const popoverID__2 = htmlIdGenerator('popover')();

const onButtonClick = () => {
setIsPopoverOpen(!isPopoverOpen);
};
Expand Down Expand Up @@ -87,7 +91,7 @@ export default () => {
<EuiForm component="form">
<EuiFormRow>
<EuiSwitch
id={htmlIdGenerator()()}
id={switchID}
name="popswitch"
label="Isn't this popover form cool?"
checked={isSwitchChecked}
Expand All @@ -111,15 +115,15 @@ export default () => {
return (
<div>
<EuiPopover
id="inlineFormPopover"
id={popoverID__1}
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}>
<div style={{ width: 500 }}>{formSample}</div>
</EuiPopover>
&emsp;
<EuiPopover
id="formPopover"
id={popoverID__2}
button={button2}
isOpen={isPopover2Open}
closePopover={closePopover2}
Expand Down

0 comments on commit 7000dd7

Please sign in to comment.