Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"dependencies": {
"@blockly/field-grid-dropdown": "^6.0.1",
"@blockly/keyboard-navigation": "2.0.0-beta.0",
"@blockly/keyboard-navigation": "1.0.0",
"@blockly/plugin-workspace-search": "10.0.0",
"@crowdin/crowdin-api-client": "^1.33.0",
"@fortawesome/fontawesome-free": "^5.15.4",
Expand All @@ -72,7 +72,7 @@
"@zip.js/zip.js": "2.4.20",
"adm-zip": "^0.5.12",
"axios": "^1.6.8",
"blockly": "12.2.0-beta.0",
"blockly": "12.1.0",
"browserify": "17.0.0",
"chai": "^3.5.0",
"chalk": "^4.1.2",
Expand Down Expand Up @@ -158,11 +158,11 @@
"combine-source-map": {
"source-map": "0.4.4"
},
"@blockly/plugin-workspace-search": {
"blockly": "12.2.0-beta.0"
"@blockly/field-colour": {
"blockly": "^12.1.0"
},
"@blockly/field-grid-dropdown": {
"blockly": "12.2.0-beta.0"
"@blockly/plugin-workspace-search": {
"blockly": "^12.1.0"
}
},
"scripts": {
Expand Down
13 changes: 13 additions & 0 deletions react-common/components/controls/FocusTrap/FocusTrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,24 @@ const FocusTrapInner = (props: FocusTrapProps) => {

const { regions } = useFocusTrapState();

const handleWindowFocus = React.useCallback(() => {
if (containerRef.current.contains(document.activeElement)) return;

const focusable = getElements();

if (focusable.length > 0) {
console.log("Focusing from outside");
focusable[0].focus();
}
}, []);

React.useEffect(() => {
window.addEventListener("focus", handleWindowFocus);
return () => {
if (!dontRestoreFocus && previouslyFocused.current) {
focusLastActive(previouslyFocused.current as HTMLElement)
}
window.removeEventListener("focus", handleWindowFocus);
}
}, [])

Expand Down