initial attempt with pwa

This commit is contained in:
Chris Kruining 2024-10-29 13:33:01 +01:00
parent ddf4519f41
commit b27abe928d
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
16 changed files with 382 additions and 220 deletions

View file

@ -177,22 +177,7 @@ const Root: ParentComponent = (props) => {
});
};
onMount(() => {
document.addEventListener('keydown', onKeyboardEvent);
document.addEventListener('keyup', onKeyboardEvent);
});
onCleanup(() => {
if (isServer) {
return;
}
document.removeEventListener('keydown', onKeyboardEvent);
document.removeEventListener('keyup', onKeyboardEvent);
});
return <div ref={setRoot} style={{ 'display': 'contents' }}>{c()}</div>;
// return <div ref={setRoot}>{c()}</div>;
return <div ref={setRoot} tabIndex={0} onKeyDown={onKeyboardEvent} onKeyUp={onKeyboardEvent} style={{ 'display': 'contents' }}>{c()}</div>;
};
export const selectable = (element: HTMLElement, options: Accessor<{ value: object, key?: string }>) => {