Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1058f3c

Browse filesBrowse files
committed
fix(light): Stop menu from opening if values are cleared
1 parent f0167cc commit 1058f3c
Copy full SHA for 1058f3c

File tree

Expand file treeCollapse file tree

1 file changed

+16
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-1
lines changed
Open diff view settings
Collapse file

‎light/src/components/select.vue‎

Copy file name to clipboardExpand all lines: light/src/components/select.vue
+16-1Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
ref="btn"
1212
>
1313
<span class="cl-btn-selection">{{ selection ?? selectedStr }}</span>
14-
<span :class="{ clearable: clearable && !isEmpty }" class="cl-btn-suffix" @click="clear">
14+
<span
15+
:class="{ clearable: clearable && !isEmpty }"
16+
class="cl-btn-suffix"
17+
@click="iconClicked"
18+
>
1519
<CloseCircleFilled v-if="clearable && !isEmpty" />
1620
<DownOutlined v-else />
1721
</span>
@@ -83,13 +87,24 @@ export default defineComponent({
8387
}
8488
}
8589
90+
function iconClicked(e: Event) {
91+
if (!props.clearable || s.isEmpty.value) {
92+
return
93+
}
94+
if (!menu.value) {
95+
e.stopPropagation()
96+
}
97+
s.clear()
98+
}
99+
86100
return {
87101
...s,
88102
menu,
89103
toggleMenu,
90104
btn,
91105
floating,
92106
floatingStyles,
107+
iconClicked,
93108
}
94109
},
95110
})

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.