small fix
This commit is contained in:
parent
5964510036
commit
18e28fe8b0
1 changed files with 9 additions and 9 deletions
|
|
@ -104,7 +104,6 @@ export function App() {
|
||||||
window.onkeydown = onKeyDown;
|
window.onkeydown = onKeyDown;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
const [highlighted, setHighlighted] = useState(
|
const [highlighted, setHighlighted] = useState(
|
||||||
commands.map(() => false));
|
commands.map(() => false));
|
||||||
|
|
||||||
|
|
@ -117,7 +116,8 @@ export function App() {
|
||||||
|
|
||||||
const onSelectExample = (e: React.SyntheticEvent<HTMLSelectElement>) => {
|
const onSelectExample = (e: React.SyntheticEvent<HTMLSelectElement>) => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (e.target.value) {
|
if (e.target.value >= 0) {
|
||||||
|
// @ts-ignore
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
pushHistory(_ => examples[e.target.value][1]);
|
pushHistory(_ => examples[e.target.value][1]);
|
||||||
}
|
}
|
||||||
|
|
@ -135,8 +135,8 @@ export function App() {
|
||||||
{descr}
|
{descr}
|
||||||
</span>)
|
</span>)
|
||||||
}
|
}
|
||||||
<select onClick={onSelectExample}>
|
<select onChange={onSelectExample} value={-1}>
|
||||||
<option>load example...</option>
|
<option value={-1}>load example...</option>
|
||||||
{
|
{
|
||||||
examples.map(([name], i) => {
|
examples.map(([name], i) => {
|
||||||
return <option key={i} value={i}>{name}</option>;
|
return <option key={i} value={i}>{name}</option>;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue