Fixed #5141 - Add highlightOnSelect and showTick props to Dropdown

This commit is contained in:
mertsincan 2024-01-24 10:44:00 +00:00
parent a4ad0bba81
commit df5142074d
4 changed files with 53 additions and 9 deletions

View file

@ -61,6 +61,8 @@ const css = `
white-space: nowrap;
position: relative;
overflow: hidden;
display: flex;
align-items: center;
}
.p-dropdown-item-group {
@ -134,14 +136,16 @@ const classes = {
wrapper: 'p-dropdown-items-wrapper',
list: 'p-dropdown-items',
itemGroup: 'p-dropdown-item-group',
item: ({ instance, state, option, focusedOption }) => [
item: ({ instance, props, state, option, focusedOption }) => [
'p-dropdown-item',
{
'p-highlight': instance.isSelected(option),
'p-highlight': instance.isSelected(option) && props.highlightOnSelect,
'p-focus': state.focusedOptionIndex === focusedOption,
'p-disabled': instance.isOptionDisabled(option)
}
],
tickIcon: 'p-dropdown-tick-icon',
blankIcon: 'p-dropdown-blank-icon',
emptyMessage: 'p-dropdown-empty-message'
};