fix error
This commit is contained in:
parent
50a1b7e2d5
commit
5862248153
2 changed files with 6 additions and 4 deletions
|
@ -75,6 +75,10 @@ const Root: ParentComponent<{ commands: CommandType[] }> = (props) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const listener = (e: KeyboardEvent) => {
|
const listener = (e: KeyboardEvent) => {
|
||||||
|
if (!e.key) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const key = e.key.toLowerCase();
|
const key = e.key.toLowerCase();
|
||||||
const modifiers =
|
const modifiers =
|
||||||
(e.shiftKey ? 1 : 0) << 0 |
|
(e.shiftKey ? 1 : 0) << 0 |
|
||||||
|
|
|
@ -47,7 +47,7 @@ export function Grid(props: { class?: string, rows: Entry[], locales: string[],
|
||||||
renderer: ({ row, column, value, mutate }) => {
|
renderer: ({ row, column, value, mutate }) => {
|
||||||
const entry = rows().value[row]!;
|
const entry = rows().value[row]!;
|
||||||
|
|
||||||
return <TextArea row={row} key={entry.key} lang={String(column)} value={value} oninput={e => mutate(e.data ?? '')} />;
|
return <TextArea row={row} key={entry.key} lang={String(column)} value={value ?? ''} oninput={e => mutate(e.data ?? '')} />;
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
]);
|
]);
|
||||||
|
@ -58,9 +58,7 @@ export function Grid(props: { class?: string, rows: Entry[], locales: string[],
|
||||||
const r = rows();
|
const r = rows();
|
||||||
const l = locales();
|
const l = locales();
|
||||||
|
|
||||||
r.mutateEach(({ key, ...rest }) => {
|
r.mutateEach(({ key, ...rest }) => ({ key, ...Object.fromEntries(l.map(locale => [locale, rest[locale] ?? ''])) }));
|
||||||
return ({ key, ...Object.fromEntries(l.map(locale => [locale, rest[locale] ?? ''])) });
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue