pull/6569/head
tugcekucukoglu 2024-10-11 09:30:55 +03:00
parent 42c356c7ce
commit d929c60ba2
2 changed files with 20 additions and 6 deletions

View File

@ -346,14 +346,28 @@ export default {
isFocus && focus(this.$refs.focusInput); isFocus && focus(this.$refs.focusInput);
}, },
onOptionMouseEnter(event) { 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); this.onOptionChange(event);
} else if (!this.dirty && event.processedOption.level === 0) { } else if (!this.dirty && event.processedOption.level === 0) {
this.onOptionClick(event); 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) { onOptionMouseMove(event) {
if (this.focused) { if (this.focused && this.focusOnHover) {
this.changeFocusedOptionIndex(event, event.processedOption.index); this.changeFocusedOptionIndex(event, event.processedOption.index);
} }
}, },

View File

@ -165,7 +165,7 @@ const theme = ({ dt }) => `
color: ${dt('cascadeselect.option.selected.color')}; 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')}; background: ${dt('cascadeselect.option.selected.focus.background')};
color: ${dt('cascadeselect.option.selected.focus.color')}; color: ${dt('cascadeselect.option.selected.focus.color')};
} }