Populate detail on first_connected shortcut re-fires#106
Merged
DmitrySharabin merged 1 commit intomainfrom May 4, 2026
Merged
Conversation
✅ Deploy Preview for nude-element ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
fbe6640 to
7589101
Compare
This was referenced May 1, 2026
LeaVerou
reviewed
May 1, 2026
LeaVerou
reviewed
May 1, 2026
LeaVerou
reviewed
May 1, 2026
7589101 to
4125197
Compare
The re-fire previously dispatched a PropChangeEvent with no detail, so a listener that read e.detail.value would crash on the catch-up dispatch while succeeding on the regular dispatch. Populate a minimal detail with source: "initial" (marker for synthetic catch-up) and value (the field whose absence caused the crash). Found while integration-testing nude-element against color-elements (<space-picker value="oklab" onspacechange="…"> exercises this path).
4125197 to
b377bf8
Compare
LeaVerou
approved these changes
May 4, 2026
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.
Summary
first_connectedre-fires shortcut events for late-boundon*=handlers, but dispatched them with nodetail. A listener readinge.detail.valuecrashed on the catch-up while succeeding on the regular dispatch.Populate a minimal detail:
{ source: "initial", value }.source: "initial"is a new enum value marking the synthetic catch-up.Why
Found integration-testing against color-elements.
<space-picker value="oklab" onspacechange="…">attaches its listener via theonspacechange=attribute after the element has constructed and connected — so the late-bound listener only sees the catch-up dispatch.Scope
Extracted from #102 (commit
72e605d) so it can land independently — pre-existing bug, unrelated to that PR's batching.Test plan
npm test -- --ci— 97/98 PASS, 1 pre-existing skip, 0 FAILcolor-elementsNo unit test added — the catch-up path needs
customElements.define+ real DOM, which the JS-first FakeElement infrastructure doesn't provide.