From c6370fccf96496bdcb6018658b2cd9414b627afb Mon Sep 17 00:00:00 2001 From: Boris Petrov Date: Fri, 2 Dec 2022 14:19:47 +0200 Subject: [PATCH] Allow passing `false` to the `on` modifier's options --- packages/@glimmer/runtime/lib/modifiers/on.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/@glimmer/runtime/lib/modifiers/on.ts b/packages/@glimmer/runtime/lib/modifiers/on.ts index 8cafff303e..0f5ceaeb42 100644 --- a/packages/@glimmer/runtime/lib/modifiers/on.ts +++ b/packages/@glimmer/runtime/lib/modifiers/on.ts @@ -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;