ensure table works on mobile (#1277)

* ensure tables works on mobile

* remove logs

* formatting
This commit is contained in:
pngwn 2022-05-16 19:55:24 +01:00 committed by GitHub
parent 2a93225952
commit 79895e0e9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -14,7 +14,7 @@
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1"
/>
<script type="module" src="./src/main.ts"></script>

View File

@ -376,7 +376,7 @@
els[editing].cell !== event.target &&
!els[editing].cell?.contains(event?.target as Node | null)
) {
header_edit = false;
editing = false;
}
}
@ -451,7 +451,10 @@
let dragging = false;
</script>
<svelte:window on:click={handle_click_outside} />
<svelte:window
on:click={handle_click_outside}
on:touchstart={handle_click_outside}
/>
<div
class="scroll-hide whitespace-nowrap overflow-hidden rounded-lg relative border transition-colors overflow-x-scroll"
@ -530,6 +533,7 @@
<td
tabindex="0"
bind:this={els[id].cell}
on:touchstart={() => start_edit(id)}
on:click={() => handle_cell_click(id)}
on:dblclick={() => start_edit(id)}
on:keydown={(e) => handle_keydown(e, i, j, id)}