Skip to content

Commit 2f74f04

Browse files
committed
chore(FilterPicker): stories
1 parent 07bab46 commit 2f74f04

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/components/actions/ItemAction/ItemAction.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export const ItemAction = forwardRef(function ItemAction(
198198
);
199199

200200
// Set tabIndex when in context
201-
const finalTabIndex = disableActionsFocus ? -1 : rest.tabIndex || undefined;
201+
const finalTabIndex = disableActionsFocus ? -1 : rest.tabIndex ?? undefined;
202202

203203
// Determine if we should show tooltip (icon-only buttons)
204204
const showTooltip = !children && tooltip;

src/components/fields/FilterPicker/FilterPicker.stories.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,6 @@ export const CustomSummary: Story = {
647647
return `${selectedKeys.length} items selected (${selectedLabels.slice(0, 2).join(', ')}${selectedKeys.length > 2 ? '...' : ''})`;
648648
},
649649
},
650-
play: async ({ canvasElement }) => {
651-
const canvas = within(canvasElement);
652-
const trigger = canvas.getByRole('button');
653-
await userEvent.click(trigger);
654-
},
655650
render: (args) => (
656651
<FilterPicker {...args}>
657652
<FilterPicker.Section title="Fruits">
@@ -674,7 +669,7 @@ export const CustomSummary: Story = {
674669
docs: {
675670
description: {
676671
story:
677-
'Use the `renderSummary` prop to customize how the selection is displayed in the trigger button.',
672+
'Use the `renderSummary` prop to customize how the selection is displayed in the trigger button. When the custom renderer returns null (e.g., when no selection is made), the placeholder is shown instead.',
678673
},
679674
},
680675
},
@@ -689,11 +684,6 @@ export const NoSummary: Story = {
689684
icon: <FilterIcon />,
690685
rightIcon: null,
691686
},
692-
play: async ({ canvasElement }) => {
693-
const canvas = within(canvasElement);
694-
const trigger = canvas.getByRole('button');
695-
await userEvent.click(trigger);
696-
},
697687
render: (args) => (
698688
<FilterPicker {...args}>
699689
{fruits.map((fruit) => (
@@ -707,7 +697,7 @@ export const NoSummary: Story = {
707697
docs: {
708698
description: {
709699
story:
710-
'When `renderSummary={false}`, no text is shown in the trigger, making it useful for icon-only filter buttons.',
700+
'When `renderSummary={false}`, no text is shown in the trigger, making it useful for icon-only filter buttons. The trigger displays only the icon, regardless of selection state.',
711701
},
712702
},
713703
},

0 commit comments

Comments
 (0)