fix: bundle emoji-picker data locally for Capacitor Android

The emoji grid wasn't rendering on Android because emoji-picker-element
defaults to fetching its data.json from jsdelivr, and CapacitorHttp's
patched fetch breaks the library's ETag-based revalidation flow. Bundle
emoji-picker-element-data via Vite's ?url import so the JSON ships as a
same-origin asset.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jon Staab
2026-04-28 14:15:12 -07:00
parent 32c1501e9c
commit c5be477855
3 changed files with 11 additions and 1 deletions
+2 -1
View File
@@ -10,6 +10,7 @@
<script lang="ts">
import "emoji-picker-element"
import emojiDataUrl from "emoji-picker-element-data/en/emojibase/data.json?url"
import type {Emoji} from "emoji-picker-element/shared"
import {onMount} from "svelte"
@@ -26,4 +27,4 @@
})
</script>
<emoji-picker bind:this={element} class="m-auto"></emoji-picker>
<emoji-picker bind:this={element} data-source={emojiDataUrl} class="m-auto"></emoji-picker>