Skip to content

Commit fe94924

Browse files
committed
chore(ListBox): provide menuitem and listboxitem mods when applicable
1 parent 8d83ece commit fe94924

File tree

5 files changed

+5
-12
lines changed

5 files changed

+5
-12
lines changed

.changeset/stupid-tomatoes-live.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/components/actions/Menu/MenuItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export function MenuItem<T>(props: MenuItemProps<T>) {
9494
selected: isSelected,
9595
disabled: isDisabled,
9696
submenu: !!submenuContext,
97+
menuitem: true,
9798
};
9899

99100
return (

src/components/content/Item/Item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const ItemElement = tasty({
253253
outlineOffset: 1,
254254
cursor: {
255255
'': 'default',
256-
':is(button) | :is(a) | listboxitem': 'pointer',
256+
':is(button) | :is(a)': 'pointer',
257257
disabled: 'not-allowed',
258258
},
259259

src/components/fields/ListBox/ListBox.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ const ListBoxScrollElement = tasty({
114114
// Create an extended Item for ListBox options with 'all' modifier support
115115
const ListBoxItem = tasty(Item, {
116116
as: 'li',
117-
mods: {
118-
listboxitem: true,
119-
},
120117
styles: {
121118
margin: {
122119
'': '0 0 1bw 0',
@@ -425,6 +422,7 @@ const SelectAllOption = ({
425422
isDisabled={isDisabled}
426423
icon={checkboxIcon}
427424
mods={{
425+
listboxitem: true,
428426
disabled: isDisabled,
429427
checkable: isCheckable,
430428
hovered: isHovered,
@@ -1222,6 +1220,7 @@ function Option({
12221220
tooltip={item.props?.tooltip}
12231221
defaultTooltipPlacement="right"
12241222
mods={{
1223+
listboxitem: true,
12251224
focused: isFocused,
12261225
pressed: isPressed,
12271226
valid: isSelected && validationState === 'valid',

src/components/fields/Select/Select.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ export const ListBoxElement = tasty({
116116
const OptionItem = tasty(Item, {
117117
as: 'li',
118118
qa: 'Option',
119-
mods: {
120-
listboxitem: true,
121-
},
122119
styles: {
123120
'$inline-compensation': '0px',
124121
},
@@ -719,6 +716,7 @@ function Option({ item, state, styles, shouldUseVirtualFocus, size }) {
719716
ref={ref}
720717
qa={qa}
721718
mods={{
719+
listboxitem: true,
722720
selected: isSelected,
723721
focused: shouldUseVirtualFocus ? isVirtualFocused : isFocused,
724722
disabled: isDisabled,

0 commit comments

Comments
 (0)