Skip to content

Commit fce83fe

Browse files
committed
(kb) trying out something, this needs a followup
the idea is to fix all the interactions where we start focused on the creator panel and the app ends up focusing the clipboard element by itself, for example when transforming a column type (after applying the transform). In those cases for now we end up in a weird state where the regionFocusSwitcher says we are on the creator panel, but the document.activeElement is the hidden textarea (clipboard el).
1 parent c1579b4 commit fce83fe

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

app/client/components/Clipboard.js

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ function Clipboard(app) {
7777
onDefaultFocus: () => {
7878
this.copypasteField.value = ' ';
7979
this.copypasteField.select();
80+
if (window.gristRegionFocusSwitcher) {
81+
window.gristRegionFocusSwitcher.focusActiveSection();
82+
}
8083
this._app.trigger('clipboard_focus');
8184
},
8285
onDefaultBlur: () => {

app/client/ui/PagePanels.ts

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ export function pagePanels(
7878
let onLeftTransitionFinish = noop;
7979

8080
const regionFocusSwitcher = RegionFocusSwitcher.create(null, options.gristDoc);
81+
// @ts-expect-error just dirty code to check an idea. To remove later.
82+
window.gristRegionFocusSwitcher = regionFocusSwitcher;
8183

8284
// When switching to mobile mode, close panels; when switching to desktop, restore the
8385
// last desktop state.

0 commit comments

Comments
 (0)