Skip to content

Commit

Permalink
fix: #66 import color picker dynamically since it cannot render serve…
Browse files Browse the repository at this point in the history
…r side
  • Loading branch information
josdejong committed Apr 15, 2022
1 parent f1410dd commit b6041bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/hooks.js

This file was deleted.

7 changes: 4 additions & 3 deletions src/lib/components/controls/ColorPickerPopup.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script>
import { onDestroy, onMount, tick } from 'svelte'
import VanillaPicker from 'vanilla-picker'
import { onDestroy, onMount } from 'svelte'
export let color
export let onChange
Expand All @@ -10,7 +9,9 @@
let colorPicker
onMount(async () => {
await tick() // must render the DOM first
// Dynamically import VanillaPicker, because it requires `document` to be defined,
// and that is not supported server side
const VanillaPicker = import('vanilla-picker')
colorPicker = new VanillaPicker({
parent: ref,
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/modes/codemode/CodeMode.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.contents {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
min-width: 0;
min-height: 0;
Expand Down

0 comments on commit b6041bb

Please sign in to comment.