Click in order · Svelte and SvelteKit course · Module 1: Introduction to Svelte
Replacements for Event Modifiers
Click the Svelte 5 replacements for the old modifiers in order: preventing the default action, stopping propagation, listening in the capture phase
Items to click
- event.stopPropagation()
- onclickcapture
- event.preventDefault()
Show the answer
Correct order:
- event.preventDefault()
- event.stopPropagation()
- onclickcapture