Repository navigation
don't dispatch an input event on the initial render - #2488
Open
Umer-Butt07 wants to merge 2 commits into
Open
Umer-Butt07 wants to merge 2 commits into
Umer-Butt07 wants to merge 2 commits into
Conversation
Fil
reviewed
Dec 1, 2026
Comment on lines
185
to
186
| if (!rendered) return; | ||
| figure.dispatchEvent(new context.document.defaultView.Event("input", {bubbles: true})); |
Contributor
There was a problem hiding this comment.
Suggested change
| if (!rendered) return; | |
| figure.dispatchEvent(new context.document.defaultView.Event("input", {bubbles: true})); | |
| if (rendered) figure.dispatchEvent(new context.document.defaultView.Event("input", {bubbles: true})); |
Author
|
thanks, applied the inline conditional. the pointer/document tests, lint and type checks pass. the full suite has one projection snapshot mismatch that also reproduces on the unchanged base. |
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.
The pointer transform renders with a null value during Plot.plot, which called context.dispatchValue and dispatched an input event on the plot before it was returned, when there can't be any listeners yet. This also needed document.defaultView.Event during server-side rendering.
dispatchValue now still sets the initial value (null) but only dispatches the input event after the plot has been rendered; pointing afterwards dispatches as before.
Closes #2160
Tests
pnpm vitest run test/pointer-test.js test/document-test.js— passed. New pointer-test cases check that the initial render dispatches no input event (value is null, for both svg and figure) and that pointing dispatches one. The existing document-test case asserted the initial dispatch; it now checks the document's Event is used when pointing.pnpm run lintandpnpm run tsc— passed.pnpm run teston Windows: the only failures were timeouts that passed on rerun and two tests that fail the same way on main (docs-test, timeAxisLocal snapshot).