Skip to content

Commit

Permalink
Change Reveal event hook to prevent glitches on submitting placeholders
Browse files Browse the repository at this point in the history
The updateCurrentSlide function is used to trigger focusing on
the input text box. Previously, hooking into the slidechanged event
led to the text box receiving focus before the transition finished,
which led to glitchy visual behavior. Hooking into the slidetransitioned
event now leads to the text box receiving focus after the transition,
which leads to a smoother experience.
  • Loading branch information
jack126guy committed Nov 23, 2024
1 parent 77fa324 commit ecf2c92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ function updateCurrentSlide(e: Event) {
}
onMounted(() => {
Reveal.on('slidechanged', updateCurrentSlide);
Reveal.on('slidetransitionend', updateCurrentSlide);
});
onUnmounted(() => {
Reveal.off('slidechanged', updateCurrentSlide);
Reveal.off('slidetransitionend', updateCurrentSlide);
});
</script>

Expand Down

0 comments on commit ecf2c92

Please sign in to comment.