forked from taikoxyz/taiko-mono
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bridge-ui-v2): token dropdown click away (taikoxyz#14224)
- Loading branch information
1 parent
61138a8
commit 4f879cb
Showing
4 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/bridge-ui-v2/src/components/ClickMask/ClickMask.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte'; | ||
import { noop, onDestroy } from 'svelte/internal'; | ||
export let active = false; | ||
export let fn = noop; | ||
let mask: HTMLDivElement; | ||
onMount(() => { | ||
mask?.addEventListener('click', fn); | ||
}); | ||
onDestroy(() => { | ||
mask?.removeEventListener('click', fn); | ||
}); | ||
$: displayClass = active ? 'block' : 'hidden'; | ||
</script> | ||
|
||
<div class="{displayClass} fixed top-0 right-0 bottom-0 left-0" bind:this={mask} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as ClickMask } from './ClickMask.svelte'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters