Skip to content

Commit a4b558b

Browse files
authored
Merge pull request #498 from mashmatrix/support-slds-2-show-picklist-dividers-expectedly
Show `Picklist` dividers expectedly
2 parents eb931eb + db5cb4b commit a4b558b

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

src/scripts/Picklist.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -694,12 +694,8 @@ export const PicklistItem: FC<PicklistItemProps> = ({
694694
}
695695
);
696696

697-
const listItemClassNames = classnames(
698-
'slds-listbox__item',
699-
divider ? `slds-has-divider_${divider}-space` : undefined
700-
);
701697
const mainListItem = (
702-
<li role='presentation' className={listItemClassNames}>
698+
<li role='presentation' className='slds-listbox__item'>
703699
<div
704700
id={value ? `${optionIdPrefix}-${value}` : undefined}
705701
className={itemClassNames}

stories/Picklist.stories.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,36 @@ export const WithTooltip: ComponentStoryObj<typeof Picklist> = {
268268
},
269269
},
270270
};
271+
272+
/**
273+
*
274+
*/
275+
export const WithDividers: ComponentStoryObj<typeof Picklist> = {
276+
name: 'With Dividers',
277+
args: {
278+
label: 'Picklist Label',
279+
defaultOpened: true,
280+
children: [
281+
<PicklistItem
282+
key='1'
283+
label='Picklist Item One'
284+
value='1'
285+
divider='bottom'
286+
/>,
287+
<PicklistItem key='2' label='Picklist Item Two' value='2' />,
288+
<PicklistItem
289+
key='3'
290+
label='Picklist Item Three'
291+
value='3'
292+
divider='top'
293+
/>,
294+
],
295+
},
296+
parameters: {
297+
docs: {
298+
description: {
299+
story: 'Picklist with dividers',
300+
},
301+
},
302+
},
303+
};

0 commit comments

Comments
 (0)