File: src/lib/pagination/tabs.tsx
The bug:
function Tabs({ items, ..., defaultSelectedKey, ...props }) {
const [selectedKey, setSelectedKey] = useState<Key | undefined>(defaultSelectedKey);
// ...
return (
<AriaTabs {...props} onSelectionChange={handleSelection}>
defaultSelectedKey is destructured out of props before the spread, so it never reaches AriaTabs. The wrapper then maintains its own selectedKey state purely to render the underline highlight. Consequences:
Passing only selectedKey: panel is controlled, underline stays at undefined until the user clicks.
Passing only defaultSelectedKey: underline correct, but AriaTabs falls back to its first item (no default).
Every controlled caller has to pass both keys.
External changes to selectedKey (e.g. URL navigation) don't update the underline.
Suggested fix: forward defaultSelectedKey to AriaTabs, drop the wrapper's own state, derive the underline highlight by reading AriaTabs' selected state via TabRenderProps/useTabsContext instead of duplicating it.
File: src/lib/pagination/tabs.tsx
The bug:
defaultSelectedKey is destructured out of props before the spread, so it never reaches AriaTabs. The wrapper then maintains its own selectedKey state purely to render the underline highlight. Consequences:
Passing only selectedKey: panel is controlled, underline stays at undefined until the user clicks.
Passing only defaultSelectedKey: underline correct, but AriaTabs falls back to its first item (no default).
Every controlled caller has to pass both keys.
External changes to selectedKey (e.g. URL navigation) don't update the underline.
Suggested fix: forward defaultSelectedKey to AriaTabs, drop the wrapper's own state, derive the underline highlight by reading AriaTabs' selected state via TabRenderProps/useTabsContext instead of duplicating it.