only tab to switch if focusing on app container

This commit is contained in:
Ryan Di 2025-04-02 20:15:04 +11:00
parent f35c4c2b46
commit beb0bd1528

View file

@ -4158,7 +4158,10 @@ class App extends React.Component<AppProps, AppState> {
// Shape switching
if (event.key === KEYS.ESCAPE) {
editorJotaiStore.set(shapeSwitchAtom, null);
} else if (event.key === KEYS.TAB) {
} else if (
event.key === KEYS.TAB &&
document.activeElement === this.excalidrawContainerRef?.current
) {
event.preventDefault();
const { generic, linear } =