Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/scripts/Picklist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -694,12 +694,8 @@ export const PicklistItem: FC<PicklistItemProps> = ({
}
);

const listItemClassNames = classnames(
'slds-listbox__item',
divider ? `slds-has-divider_${divider}-space` : undefined
);
const mainListItem = (
<li role='presentation' className={listItemClassNames}>
<li role='presentation' className='slds-listbox__item'>
<div
id={value ? `${optionIdPrefix}-${value}` : undefined}
className={itemClassNames}
Expand Down
33 changes: 33 additions & 0 deletions stories/Picklist.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,36 @@ export const WithTooltip: ComponentStoryObj<typeof Picklist> = {
},
},
};

/**
*
*/
export const WithDividers: ComponentStoryObj<typeof Picklist> = {
name: 'With Dividers',
args: {
label: 'Picklist Label',
defaultOpened: true,
children: [
<PicklistItem
key='1'
label='Picklist Item One'
value='1'
divider='bottom'
/>,
<PicklistItem key='2' label='Picklist Item Two' value='2' />,
<PicklistItem
key='3'
label='Picklist Item Three'
value='3'
divider='top'
/>,
],
},
parameters: {
docs: {
description: {
story: 'Picklist with dividers',
},
},
},
};