Refactor #6538
parent
42c356c7ce
commit
d929c60ba2
|
@ -346,14 +346,28 @@ export default {
|
|||
isFocus && focus(this.$refs.focusInput);
|
||||
},
|
||||
onOptionMouseEnter(event) {
|
||||
if (this.dirty || (!this.dirty && isNotEmpty(this.modelValue))) {
|
||||
if (this.focusOnHover) {
|
||||
if (isNotEmpty(this.modelValue)) {
|
||||
const { originalEvent, processedOption } = event;
|
||||
const { index, level, parentKey } = processedOption;
|
||||
|
||||
this.focusedOptionInfo = { index, level, parentKey };
|
||||
this.changeFocusedOptionIndex(originalEvent, index);
|
||||
} else if (this.dirty || (!this.dirty && isNotEmpty(this.modelValue))) {
|
||||
this.onOptionChange(event);
|
||||
} else if (!this.dirty && event.processedOption.level === 0) {
|
||||
this.onOptionClick(event);
|
||||
}
|
||||
} else {
|
||||
// if (this.dirty || (!this.dirty && isNotEmpty(this.modelValue))) {
|
||||
// this.onOptionChange(event);
|
||||
// } else if (!this.dirty && event.processedOption.level === 0) {
|
||||
// this.onOptionClick(event);
|
||||
// }
|
||||
}
|
||||
},
|
||||
onOptionMouseMove(event) {
|
||||
if (this.focused) {
|
||||
if (this.focused && this.focusOnHover) {
|
||||
this.changeFocusedOptionIndex(event, event.processedOption.index);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -165,7 +165,7 @@ const theme = ({ dt }) => `
|
|||
color: ${dt('cascadeselect.option.selected.color')};
|
||||
}
|
||||
|
||||
.p-cascadeselect-option-selected.p-focus {
|
||||
.p-cascadeselect-option-selected.p-focus > .p-cascadeselect-option-content {
|
||||
background: ${dt('cascadeselect.option.selected.focus.background')};
|
||||
color: ${dt('cascadeselect.option.selected.focus.color')};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue