Prevent key propagation in controls panel
This commit is contained in:
parent
6ef197e30a
commit
a568de9557
1 changed files with 5 additions and 0 deletions
|
@ -8,6 +8,9 @@ import * as Panel from '../panel'
|
||||||
import Control from './control'
|
import Control from './control'
|
||||||
import { deepCompareArrays } from 'utils'
|
import { deepCompareArrays } from 'utils'
|
||||||
|
|
||||||
|
const stopKeyboardPropagation = (e: KeyboardEvent | React.KeyboardEvent) =>
|
||||||
|
e.stopPropagation()
|
||||||
|
|
||||||
export default function ControlPanel(): JSX.Element {
|
export default function ControlPanel(): JSX.Element {
|
||||||
const rContainer = useRef<HTMLDivElement>(null)
|
const rContainer = useRef<HTMLDivElement>(null)
|
||||||
const codeControls = useSelector(
|
const codeControls = useSelector(
|
||||||
|
@ -23,6 +26,8 @@ export default function ControlPanel(): JSX.Element {
|
||||||
ref={rContainer}
|
ref={rContainer}
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
variant="controls"
|
variant="controls"
|
||||||
|
onKeyDown={stopKeyboardPropagation}
|
||||||
|
onKeyUp={stopKeyboardPropagation}
|
||||||
>
|
>
|
||||||
{isOpen ? (
|
{isOpen ? (
|
||||||
<Panel.Layout>
|
<Panel.Layout>
|
||||||
|
|
Loading…
Reference in a new issue