Repository navigation
fix(core): forward pass-through props on seven BaseProps components - #5563
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsMetadataList (@astryxdesign/core) · View in Storybook
NavMenu (@astryxdesign/core) · View in Storybook
Timestamp (@astryxdesign/core) · View in Storybook
Token (@astryxdesign/core) · View in Storybook
TopNav (@astryxdesign/core) · View in Storybook
Typeahead (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 2 accessibility violation(s) found — 2 serious. Timestamp - 1 issue(s)
Token - 1 issue(s)
Visual RegressionStatus: Skipped — 256 shots exceeds the 240-shot budget (6 components touched) — too broad to review shot by shot here. The daily release gate covers this change against the full baseline. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Complete the BaseProps forwarding fix after List, Markdown, and TreeList landed separately. Preserve component-owned attribute precedence and compose caller handlers before built-in behavior.
af004c6 to
84f3a17
Compare
|
Solid work - the pass-through + One thing worth flagging on the PR analysis report: the two serious a11y violations it surfaced (color contrast, WCAG 1.4.3) on Timestamp and Token are not regressions from this change. This PR only forwards props and reorders attributes - it does not touch any color values. So whatever contrast failures exist on those two components are pre-existing in the base component/theme, not introduced here, and should not block this merge or be attributed to it. They are a separate, worthwhile audit of the theme layer (the color variants and disabled states are the first places I would look). The Timestamp handling is the sharpest part: keeping the component's own spelled-out relative label when the caller also passes |
Layout, MetadataList, NavHeadingMenuItem, RadioList, TimeInput, and TopNavMegaMenuItem declared extends BaseProps but destructured a closed set of props with no rest spread, so aria-*, id, data-*, and event handlers type-checked and silently never reached the DOM. Forward the rest object to the element each ref targets, composing consumer handlers in front of component-owned ones with composeEventHandlers (RadioList onFocus; TimeInput onFocus/onBlur/onKeyDown). Same class and same fix shape as the meta#5254 batches (meta#5288, meta#5493, meta#5563); these six were not in that issue's tarball-derived list. PowerSearch shares the shape and is deliberately left out - its forwarding target is an API decision.
Layout, MetadataList, NavHeadingMenuItem, RadioList, TimeInput, and TopNavMegaMenuItem declared extends BaseProps but destructured a closed set of props with no rest spread, so aria-*, id, data-*, and event handlers type-checked and silently never reached the DOM. Forward the rest object to the element each ref targets, composing consumer handlers in front of component-owned ones with composeEventHandlers (RadioList onFocus; TimeInput onFocus/onBlur/onKeyDown). Same class and same fix shape as the meta#5254 batches (meta#5288, meta#5493, meta#5563); these six were not in that issue's tarball-derived list. PowerSearch shares the shape and is deliberately left out - its forwarding target is an API decision.
Layout, MetadataList, NavHeadingMenuItem, RadioList, TimeInput, and TopNavMegaMenuItem declared extends BaseProps but destructured a closed set of props with no rest spread, so aria-*, id, data-*, and event handlers type-checked and silently never reached the DOM. Forward the rest object to the element each ref targets, composing consumer handlers in front of component-owned ones with composeEventHandlers (RadioList onFocus; TimeInput onFocus/onBlur/onKeyDown). Same class and same fix shape as the meta#5254 batches (meta#5288, meta#5493, meta#5563); these six were not in that issue's tarball-derived list. PowerSearch shares the shape and is deliberately left out - its forwarding target is an API decision.
Layout, MetadataList, NavHeadingMenuItem, RadioList, TimeInput, and TopNavMegaMenuItem declared extends BaseProps but destructured a closed set of props with no rest spread, so aria-*, id, data-*, and event handlers type-checked and silently never reached the DOM. Forward the rest object to the element that owns each component's contract, spread first so owned attributes win. Where the component owns the same event, handlers compose component-first with composeEventHandlers so owned behavior (focus normalization, arrow stepping, blur reconciliation) is uncancellable (RadioList onFocus; TimeInput onFocus/onBlur/onKeyDown on both its typed and native-picker paths). A caller id is honored via id ?? generatedId per the Selector precedent, and caller aria-labelledby and aria-describedby compose additively with the owned ids. Same class and same fix shape as the meta#5254 batches (meta#5288, meta#5493, meta#5563); these six were not in that issue's tarball-derived list. PowerSearch and MultiSelector share the shape and are deliberately left out - their forwarding is an API decision and a Selector-precedent follow-up. Co-Authored-By: Claude Fable 5 <[email protected]>
Layout, MetadataList, NavHeadingMenuItem, RadioList, TimeInput, and TopNavMegaMenuItem declared extends BaseProps but destructured a closed set of props with no rest spread, so aria-*, id, data-*, and event handlers type-checked and silently never reached the DOM. Forward the rest object to the element that owns each component's contract, spread first so owned attributes win. Where the component owns the same event, handlers compose component-first with composeEventHandlers so owned behavior (focus normalization, arrow stepping, blur reconciliation) is uncancellable (RadioList onFocus; TimeInput onFocus/onBlur/onKeyDown on both its typed and native-picker paths). A caller id is honored via id ?? generatedId per the Selector precedent, and caller aria-labelledby and aria-describedby compose additively with the owned ids. Same class and same fix shape as the meta#5254 batches (meta#5288, meta#5493, meta#5563); these six were not in that issue's tarball-derived list. PowerSearch and MultiSelector share the shape and are deliberately left out - their forwarding is an API decision and a Selector-precedent follow-up. Co-Authored-By: Claude Fable 5 <[email protected]>
Layout, MetadataList, NavHeadingMenuItem, RadioList, TimeInput, and TopNavMegaMenuItem declared extends BaseProps but destructured a closed set of props with no rest spread, so aria-*, id, data-*, and event handlers type-checked and silently never reached the DOM. Forward the rest object to the element that owns each component's contract, spread first so owned attributes win. Where the component owns the same event, handlers compose component-first with composeEventHandlers so owned behavior (focus normalization, arrow stepping, blur reconciliation) is uncancellable (RadioList onFocus; TimeInput onFocus/onBlur/onKeyDown on both its typed and native-picker paths). A caller id is honored via id ?? generatedId per the Selector precedent, and caller aria-labelledby and aria-describedby compose additively with the owned ids. Same class and same fix shape as the meta#5254 batches (meta#5288, meta#5493, meta#5563); these six were not in that issue's tarball-derived list. PowerSearch and MultiSelector share the shape and are deliberately left out - their forwarding is an API decision and a Selector-precedent follow-up. Co-Authored-By: Claude Fable 5 <[email protected]>
Layout, MetadataList, NavHeadingMenuItem, RadioList, TimeInput, and TopNavMegaMenuItem declared extends BaseProps but destructured a closed set of props with no rest spread, so aria-*, id, data-*, and event handlers type-checked and silently never reached the DOM. Forward the rest object to the element that owns each component's contract, spread first so owned attributes win. Where the component owns the same event, handlers compose component-first with composeEventHandlers so owned behavior (focus normalization, arrow stepping, blur reconciliation) is uncancellable (RadioList onFocus; TimeInput onFocus/onBlur/onKeyDown on both its typed and native-picker paths). A caller id is honored via id ?? generatedId per the Selector precedent, and caller aria-labelledby and aria-describedby compose additively with the owned ids. Same class and same fix shape as the meta#5254 batches (meta#5288, meta#5493, meta#5563); these six were not in that issue's tarball-derived list. PowerSearch and MultiSelector share the shape and are deliberately left out - their forwarding is an API decision and a Selector-precedent follow-up. Co-Authored-By: Claude Fable 5 <[email protected]>
Why
Seven remaining components declare
BasePropsbut dropped props they did not explicitly destructure. Those props type-checked yet never reached the DOM.This is the third and final change for #5254:
ListandMarkdown.TreeList.MetadataListItem,NavHeadingMenu,Timestamp,Token,TopNavMegaMenu,TopNavMenu, andTypeaheadItem.Fixes #5254.
What
aria-*,id,tabIndex, event-handler, anddata-*props to the intended DOM element.mergeProps, contract-owned attributes after the rest spread, and conditional attributes absent when the component does not own them.onClick,onMouseEnter,onMouseLeave), both drawer triggers (onClick),NavHeadingMenukeyboard handling, andTokenLinkmouse-up delegation.MetadataListItemprops on the wrapper<div>when stacked and the<dt>when inline.TypeaheadItemitem.elementearly return as a documented hole: a caller-ownedReactNodeis returned untouched rather than inventingcloneElementsemantics.Testing
origin/main: all eight implementation files were confirmed reverted; 27 new tests failed and 214 existing tests passed, so every added regression test detects this PR.@astryxdesign/coretypecheck: passed.