Open jzsplk opened 3 years ago
Vime version: 5.0.25
Provider:
[x] Audio [] Video [] HLS [] DASH [] YouTube [] Vimeo [] Dailymotion
Current behavior: When trying the svelte UI component Control, the onClick is not working when the button clicked
Control
Expected behavior: the click should be triggered.
Steps to reproduce: like the demo code in https://vimejs.com/components/ui/controls/control
codesandbox
Related code:
<Control keys="k" label={$i18n.playback} pressed={paused} on:click={onClick} bind:this={ref} > <Icon name={icon} /> <Tooltip>{tooltip} (k)</Tooltip> </Control> <script lang="ts"> import { usePlayerStore, Control, Icon, Tooltip } from '@vime/svelte'; let ref: Control; const { paused, i18n } = usePlayerStore(() => ref); const onClick = () => { $paused = !$paused; }; $: icon = $paused ? 'play' : 'pause'; $: tooltip = $paused ? $i18n.play : $i18n.pause; </script>
Other information:
Workaround: bind the event handler to the actual HTML element (ref.getWebComponent())
ref.getWebComponent()
Bug Report
Vime version: 5.0.25
Provider:
[x] Audio [] Video [] HLS [] DASH [] YouTube [] Vimeo [] Dailymotion
Current behavior: When trying the svelte UI component
Control
, the onClick is not working when the button clickedExpected behavior: the click should be triggered.
Steps to reproduce: like the demo code in https://vimejs.com/components/ui/controls/control
codesandbox
Related code:
Other information: