Conversation
When the grid is portaled into another window (iframe, popup), it should be observed by that window's ResizeObserver. Refs #4184 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lazily create one ResizeObserver per window, derived from the grid element's ownerDocument, instead of a single module-level observer created in the realm the module was loaded in. Fixes #4184 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4194 +/- ##
==========================================
+ Coverage 98.30% 98.41% +0.10%
==========================================
Files 45 45
Lines 1943 1950 +7
Branches 732 727 -5
==========================================
+ Hits 1910 1919 +9
+ Misses 33 31 -2
🚀 New features to boost your workflow:
|
Rename gridDimensions.test.tsx to crossWindow.test.tsx, and add expected-failure tests for keyboard navigation, Tab navigation out of an editor, and committing an editor on outside clicks, when the grid is rendered into an iframe. Refs #4184 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…r window - Replace `instanceof` checks, which fail for elements from another window, with a `nodeType` check and `matches()` - Listen for outside `mousedown` events, and schedule the commit check, on the window the editor is rendered in Fixes #4184 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
nstepien
marked this pull request as ready for review
September 24, 2026 02:08
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4184
When the grid is portaled into another window (e.g. an iframe, or a popup via
window.open()), its DOM nodes belong to that window, while its JS still runs in the opener's window. A few places assumed both were the same:useGridDimensions: the module-levelResizeObserverwas created in the opener's realm, so resize notifications were processed on the opener's rendering timeline, which can be throttled while the user interacts with the popup. We now lazily create oneResizeObserverper window (keyed in aWeakMap), derived from the grid element'sownerDocument.defaultView.target instanceof Elementis alwaysfalsefor elements from another window, so the grid ignored arrow keys, Tab, Home/End, PageUp/PageDown, and typing to start editing. Replaced with anodeTypecheck (isElement).onEditorNavigationusedinstanceof HTMLInputElement/HTMLTextAreaElement/HTMLSelectElement. Replaced withisElement(target) && target.matches('input, textarea, select').EditCelllistened formousedownon the opener's window, which never receives clicks from the other window. It now listens on the editor's window, and schedules/cancels the fallback check with that window'sscheduler.postTask/requestAnimationFrame.Tests live in
test/browser/crossWindow.test.tsx(renamed fromgridDimensions.test.tsx), and render the grid into an iframe viacreatePortal, usingpage.frameLocator()for real user interactions. The commit history has each test failing first.The
requestAnimationFramepart isn't covered by a test: it only matters whenpostTaskis unavailable and the opener window is hidden, which can't be simulated here.🤖 Generated with Claude Code