Event Modifiers
Modifiers change how events behave or when they fire.
Core modifiers
prevent→event.preventDefault()stop→event.stopPropagation()once→ handler runs oncepassive→ passive listeneroutside→ fires when click happens outside the elementself→ only fires when event target is the element
Example
behavior .dialog {
on click.outside.prevent() { open = false; }
}
Key modifiers
behavior .field {
on keyup.enter() { submit(); }
on keydown.shift.enter() { submit(); }
}
Ordering
Modifiers apply in the order they appear, but the end result matches the list above.