Skip to content

Commit

Permalink
docs(combobox): remove separate tab focus for nested pickerbutton (#3507
Browse files Browse the repository at this point in the history
)

The Picker Button that is nested within Combobox was previously tab
focusable, separately from the Combobox itself. This update gives it
a negative tabindex, making it consistent with the intended behavior
and SWC implementation.

This adds a tabindex option to the Picker Button template.
  • Loading branch information
jawinn authored Jan 16, 2025
1 parent 6eff801 commit 60f5a3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/combobox/stories/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const Combobox = ({
onclick: function () {
updateArgs({ isOpen: !isOpen });
},
tabindex: "-1",
}, context)}
</div>
`;
Expand Down
2 changes: 2 additions & 0 deletions components/pickerbutton/stories/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const Template = ({
isRounded = false,
customStyles = {},
onclick,
tabindex,
} = {}, context = {}) => {
const { updateArgs } = context;

Expand Down Expand Up @@ -54,6 +55,7 @@ export const Template = ({
if (isDisabled) return;
updateArgs({ isOpen: !isOpen });
}}
tabindex=${ifDefined(tabindex)}
>
<div class="${rootClass}-fill">
${when(label, () => html`
Expand Down

0 comments on commit 60f5a3d

Please sign in to comment.