Skip to content

Commit

Permalink
revert me
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsongl committed Nov 5, 2020
1 parent f1c4858 commit 8240e6f
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions src-docs/src/views/range/dual_range.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,34 @@ import { EuiDualRange } from '../../../../src/components';
import { htmlIdGenerator } from '../../../../src/services';

export default () => {
const [value, setValue] = useState(['', '']);
const [value, setValue] = useState(['20', '100']);
const [isOpen, setIsOpen] = useState(false);

const onChange = (value) => {
setValue(value);
};

const onToggle = () => {
setIsOpen(!isOpen);
};

return (
<EuiDualRange
id={htmlIdGenerator()()}
min={-100}
max={200}
step={10}
value={value}
onChange={onChange}
showLabels
aria-label="An example of EuiDualRange"
/>
<div>
<button type="button" onClick={onToggle}>
Toggle
</button>
<div className={isOpen ? '' : 'eui-showFor'}>
<EuiDualRange
id={htmlIdGenerator()()}
min={0}
max={200}
step={10}
value={value}
onChange={onChange}
showLabels
aria-label="An example of EuiDualRange"
/>
</div>
</div>
);
};

0 comments on commit 8240e6f

Please sign in to comment.