From 315a8d8cff126097f5274d6366cb9dea7d043265 Mon Sep 17 00:00:00 2001 From: orastvorov Date: Fri, 20 Jan 2023 11:15:28 +0200 Subject: [PATCH] GH-47: set physicalKeyboardHighlightPreventDefault prop in Keyboard component depending on current tab --- frontend/src/components/keyboard/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/keyboard/index.js b/frontend/src/components/keyboard/index.js index 0925738..83a2f57 100644 --- a/frontend/src/components/keyboard/index.js +++ b/frontend/src/components/keyboard/index.js @@ -8,7 +8,10 @@ import './style.css' import { display, layout, buttonTheme, buttonAttributes, useStyles, syntethicKeysMap } from './keyboardSettings' const Keyboard = observer(() => { - const {rosStore: { handleKeyboardShortcuts }} = useStore() + const { + rosStore: { handleKeyboardShortcuts }, + navigationStore: { activeTab }, + } = useStore() const [layoutName, setLayoutName] = useState('default') const { classes } = useStyles(); const keyboardRef = useRef(null); @@ -44,7 +47,7 @@ const Keyboard = observer(() => { baseClass={'simple-keyboard-main'} physicalKeyboardHighlight={true} physicalKeyboardHighlightPress={true} - physicalKeyboardHighlightPreventDefault={true} + physicalKeyboardHighlightPreventDefault={activeTab === 0} physicalKeyboardHighlightTextColor={theme.palette.common.white} physicalKeyboardHighlightBgColor={theme.palette.background.keyboardButtonBgPressed} syncInstanceInputs={true}