From 1ad03d2ffef4a738a4f27412c0e8a5d9e6363ddf Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 20 Dec 2024 17:20:57 +0000 Subject: [PATCH] Don't add unused remove listeners --- src/view/com/util/forms/NativeDropdown.web.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/view/com/util/forms/NativeDropdown.web.tsx b/src/view/com/util/forms/NativeDropdown.web.tsx index c1a0b80966..b3ec319e3b 100644 --- a/src/view/com/util/forms/NativeDropdown.web.tsx +++ b/src/view/com/util/forms/NativeDropdown.web.tsx @@ -70,6 +70,10 @@ export function NativeDropdown({ const menuRef = React.useRef(null) React.useEffect(() => { + if (!open) { + return + } + function clickHandler(e: MouseEvent) { const t = e.target