small fix

This commit is contained in:
Joeri Exelmans 2025-05-14 08:19:50 +02:00
parent 5964510036
commit 18e28fe8b0

View file

@ -104,7 +104,6 @@ export function App() {
window.onkeydown = onKeyDown;
}, []);
const [highlighted, setHighlighted] = useState(
commands.map(() => false));
@ -117,7 +116,8 @@ export function App() {
const onSelectExample = (e: React.SyntheticEvent<HTMLSelectElement>) => {
// @ts-ignore
if (e.target.value) {
if (e.target.value >= 0) {
// @ts-ignore
// @ts-ignore
pushHistory(_ => examples[e.target.value][1]);
}
@ -135,8 +135,8 @@ export function App() {
{descr}
</span>)
}
<select onClick={onSelectExample}>
<option>load example...</option>
<select onChange={onSelectExample} value={-1}>
<option value={-1}>load example...</option>
{
examples.map(([name], i) => {
return <option key={i} value={i}>{name}</option>;