Skip to content

Commit

Permalink
Merge pull request #1402 from boris-petrov/fix-on-modifier
Browse files Browse the repository at this point in the history
Allow passing `false` to the `on` modifier's options
  • Loading branch information
chriskrycho authored Dec 15, 2022
2 parents 03a4b55 + c6370fc commit ec5648f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@glimmer/runtime/lib/modifiers/on.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export class OnModifierState {
}

let options: AddEventListenerOptions;
if (once || passive || capture) {
// we want to handle both `true` and `false` because both have a meaning:
// https://bugs.chromium.org/p/chromium/issues/detail?id=770208
if (once !== undefined || passive !== undefined || capture !== undefined) {
options = this.options = { once, passive, capture };
} else {
this.options = undefined;
Expand Down

0 comments on commit ec5648f

Please sign in to comment.