diff --git a/src/components/Select.tsx b/src/components/Select.tsx index 95934f8b..65bf504b 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -345,7 +345,12 @@ function Select({ }) return ( - + { + e.stopPropagation() + }} + > ( /> )) +function useTestKeyCapture() { + useEffect(() => { + const handler = (e: KeyboardEvent) => { + if (e.target === document.body) return + alert(`Select box isn’t properly stopping keypress propagation`) + } + + window.addEventListener('keydown', handler) + + return () => window.removeEventListener('keydown', handler) + }, []) +} + function Template({ onFillLevel }: { onFillLevel: any }) { const theme = useTheme() + + useTestKeyCapture() + const [selectedKey, setSelectedKey] = useState() const shownStep = 4 const [shownLimit, setShownLimit] = useState(shownStep)