Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move popover polyfill to ESM #1441

Merged
merged 1 commit into from Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -65,6 +65,7 @@
"@ffmpeg.wasm/core-mt": "0.13.2",
"@ffmpeg.wasm/main": "^0.13.1",
"@leveluptuts/svelte-side-menu": "^1.0.7",
"@oddbird/popover-polyfill": "^0.3.6",
"@prisma/client": "5.5.2",
"@sentry/profiling-node": "^1.2.6",
"@sentry/sveltekit": "^7.77.0",
Expand Down
15 changes: 11 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/app.html
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="/popover.js"></script>
<script defer data-domain="syntax.fm" src="https://plausible.io/js/script.js"></script>

%sveltekit.head%
Expand Down
6 changes: 6 additions & 0 deletions src/lib/SelectMenu.svelte
Expand Up @@ -2,6 +2,12 @@
import Icon from './Icon.svelte';
import { anchor } from '$actions/anchor';
import type { IconName } from './Icon.svelte';
// Polyfill for Popover. Remove once Firefox supports it. https://caniuse.com/?search=popover
import { apply, isSupported } from '@oddbird/popover-polyfill/fn';
import { browser } from '$app/environment';
if (!isSupported() && browser) {
apply();
}

export let options: { value: string; label: string }[];
export let button_icon: IconName | null = null;
Expand Down