Fixed #5105 - Highlight state changes on Checkbox selection mode

pull/5110/head
tugcekucukoglu 2024-01-18 16:05:30 +03:00
parent 7b7eb3df1d
commit 19f9813d16
6 changed files with 16 additions and 4 deletions

View File

@ -250,6 +250,10 @@ export default {
type: Boolean,
default: false
},
highlightOnSelect: {
type: Boolean,
default: false
},
size: {
type: String,
default: null

View File

@ -360,7 +360,7 @@ const classes = {
if (props.selection) {
rowStyleClass.push({
'p-highlight': instance.isSelected
'p-highlight': instance.isSelected && instance.$parentInstance.$parentInstance.highlightOnSelect
});
}

View File

@ -131,6 +131,10 @@ export default {
type: Boolean,
default: false
},
highlightOnSelect: {
type: Boolean,
default: false
},
filterMessage: {
type: String,
default: null

View File

@ -156,10 +156,10 @@ const classes = {
wrapper: 'p-multiselect-items-wrapper',
list: 'p-multiselect-items p-component',
itemGroup: 'p-multiselect-item-group',
item: ({ instance, option, index, getItemOptions }) => [
item: ({ instance, option, index, getItemOptions, props }) => [
'p-multiselect-item',
{
'p-highlight': instance.isSelected(option),
'p-highlight': instance.isSelected(option) && props.highlightOnSelect,
'p-focus': instance.focusedOptionIndex === instance.getOptionIndex(index, getItemOptions),
'p-disabled': instance.isOptionDisabled(option)
}

View File

@ -58,6 +58,10 @@ export default {
type: String,
default: undefined
},
highlightOnSelect: {
type: Boolean,
default: false
},
scrollHeight: {
type: String,
default: null

View File

@ -108,7 +108,7 @@ const classes = {
instance.node.styleClass,
{
'p-treenode-selectable': instance.selectable,
'p-highlight': instance.checkboxMode ? instance.checked : instance.selected
'p-highlight': instance.checkboxMode && instance.$parentInstance.highlightOnSelect ? instance.checked : instance.selected
}
],
toggler: 'p-tree-toggler p-link',