issues
search
developerasun
/
myCodeBox-web
Open source code box for web developers.
Apache License 2.0
5
stars
0
forks
source link
[RESEARCH] Client/Svelte : event modifier
#243
Open
developerasun
opened
2 years ago
developerasun
commented
2 years ago
topic : understanding event modifier in Svelte
read this
preventDefault — calls event.preventDefault() before running the handler. Useful for client-side form handling, for example.
stopPropagation — calls event.stopPropagation(), preventing the event reaching the next element
passive — improves scrolling performance on touch/wheel events (Svelte will add it automatically where it's safe to do so)
nonpassive — explicitly set passive: false
capture — fires the handler during the capture phase instead of the bubbling phase (
MDN docs
)
once — remove the handler after the first time it runs
self — only trigger handler if event.target is the element itself
trusted — only trigger handler if event.isTrusted is true. I.e. if the event is triggered by a user action.
reference
https://svelte.dev/tutorial/event-modifiers
topic : understanding event modifier in Svelte
read this
reference