From af5a0b090dca9debafba677e5f7097d33738c9c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Thu, 22 Jun 2023 16:29:47 +0300 Subject: [PATCH] Refactor #3965 - Refactor on Dropdown --- components/lib/dropdown/BaseDropdown.vue | 4 ++-- components/lib/dropdown/Dropdown.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/lib/dropdown/BaseDropdown.vue b/components/lib/dropdown/BaseDropdown.vue index 8707e2920..395b3f908 100644 --- a/components/lib/dropdown/BaseDropdown.vue +++ b/components/lib/dropdown/BaseDropdown.vue @@ -98,13 +98,13 @@ input.p-dropdown-label { `; const classes = { - root: ({ props, state }) => [ + root: ({ instance, props, state }) => [ 'p-dropdown p-component p-inputwrapper', { 'p-disabled': props.disabled, 'p-dropdown-clearable': props.showClear && !props.disabled, 'p-focus': state.focused, - 'p-inputwrapper-filled': props.hasSelectedOption, + 'p-inputwrapper-filled': instance.hasSelectedOption, 'p-inputwrapper-focus': state.focused || state.overlayVisible, 'p-overlay-open': state.overlayVisible } diff --git a/components/lib/dropdown/Dropdown.vue b/components/lib/dropdown/Dropdown.vue index 82bb7f7a7..ecd64b094 100755 --- a/components/lib/dropdown/Dropdown.vue +++ b/components/lib/dropdown/Dropdown.vue @@ -48,7 +48,7 @@ {{ label === 'p-emptylabel' ? ' ' : label || 'empty' }} - +
@@ -422,7 +422,7 @@ export default { return; } - if ((this.$refs.clearIcon && this.$refs.clearIcon.isSameNode(event.target)) || event.target.tagName === 'INPUT') { + if (event.target.tagName === 'INPUT' || event.target.getAttribute('data-pc-section') === 'clearicon' || event.target.tagName === 'path') { return; } else if (!this.overlay || !this.overlay.contains(event.target)) { this.overlayVisible ? this.hide(true) : this.show(true);