Skip to content

Commit

Permalink
[REVERT] Add documentation example to InlineEdit Text to display isRe…
Browse files Browse the repository at this point in the history
…adOnly prop
  • Loading branch information
breehall committed May 16, 2023
1 parent 0cdc03b commit 8a7b117
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src-docs/src/views/inline_edit/inline_edit_text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
EuiSpacer,
EuiButtonGroup,
EuiInlineEditTextProps,
EuiSwitch,
} from '../../../../src';

export default () => {
Expand All @@ -31,6 +32,13 @@ export default () => {
setToggleTextButtonSize(optionId);
};

/* isReadOnly toggle */
const [isReadOnly, setIsReadOnly] = useState(false);

const onChange = (e: any) => {
setIsReadOnly(e.target.checked);
};

return (
<>
<EuiButtonGroup
Expand All @@ -44,10 +52,19 @@ export default () => {

<EuiSpacer />

<EuiSwitch
label="isReadOnly"
checked={isReadOnly}
onChange={(e) => onChange(e)}
/>

<EuiSpacer />

<EuiInlineEditText
inputAriaLabel="Edit text inline"
defaultValue="Hello World!"
size={toggleTextButtonSize}
isReadOnly={isReadOnly}
/>
</>
);
Expand Down

0 comments on commit 8a7b117

Please sign in to comment.