Fixed #5105 - Highlight state changes on Checkbox selection mode
parent
7b7eb3df1d
commit
19f9813d16
|
@ -250,6 +250,10 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
highlightOnSelect: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
size: {
|
size: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
|
|
|
@ -360,7 +360,7 @@ const classes = {
|
||||||
|
|
||||||
if (props.selection) {
|
if (props.selection) {
|
||||||
rowStyleClass.push({
|
rowStyleClass.push({
|
||||||
'p-highlight': instance.isSelected
|
'p-highlight': instance.isSelected && instance.$parentInstance.$parentInstance.highlightOnSelect
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,10 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
highlightOnSelect: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
filterMessage: {
|
filterMessage: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
|
|
|
@ -156,10 +156,10 @@ const classes = {
|
||||||
wrapper: 'p-multiselect-items-wrapper',
|
wrapper: 'p-multiselect-items-wrapper',
|
||||||
list: 'p-multiselect-items p-component',
|
list: 'p-multiselect-items p-component',
|
||||||
itemGroup: 'p-multiselect-item-group',
|
itemGroup: 'p-multiselect-item-group',
|
||||||
item: ({ instance, option, index, getItemOptions }) => [
|
item: ({ instance, option, index, getItemOptions, props }) => [
|
||||||
'p-multiselect-item',
|
'p-multiselect-item',
|
||||||
{
|
{
|
||||||
'p-highlight': instance.isSelected(option),
|
'p-highlight': instance.isSelected(option) && props.highlightOnSelect,
|
||||||
'p-focus': instance.focusedOptionIndex === instance.getOptionIndex(index, getItemOptions),
|
'p-focus': instance.focusedOptionIndex === instance.getOptionIndex(index, getItemOptions),
|
||||||
'p-disabled': instance.isOptionDisabled(option)
|
'p-disabled': instance.isOptionDisabled(option)
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,10 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: undefined
|
default: undefined
|
||||||
},
|
},
|
||||||
|
highlightOnSelect: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
scrollHeight: {
|
scrollHeight: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
|
|
|
@ -108,7 +108,7 @@ const classes = {
|
||||||
instance.node.styleClass,
|
instance.node.styleClass,
|
||||||
{
|
{
|
||||||
'p-treenode-selectable': instance.selectable,
|
'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',
|
toggler: 'p-tree-toggler p-link',
|
||||||
|
|
Loading…
Reference in New Issue