Skip to content

Commit 8e3244d

Browse files
pdanpdanrstoenescu
authored andcommitted
close quasarframework#2140: Fix highlight on QSelect and QAutocomplete (quasarframework#2153)
close quasarframework#2140
1 parent e24d938 commit 8e3244d

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

src/components/autocomplete/QAutocomplete.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ export default {
241241
style: this.computedWidth
242242
},
243243
this.computedResults.map((result, index) => h(QItemWrapper, {
244-
key: result.id || JSON.stringify(result),
244+
key: result.id || index,
245245
'class': {
246-
active: this.keyboardIndex === index,
246+
'q-select-highlight': this.keyboardIndex === index,
247247
'cursor-pointer': !result.disable,
248248
'text-faded': result.disable
249249
},
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
body.desktop .q-select-highlight
2+
background $item-highlight-color !important
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
body.desktop .q-select-highlight
2+
background $item-highlight-color !important

src/components/select/QSelect.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@
103103
<template v-if="multiple">
104104
<q-item-wrapper
105105
v-for="(opt, index) in visibleOptions"
106-
:key="JSON.stringify(opt)"
106+
:key="index"
107107
:cfg="opt"
108-
:link="!opt.disable"
109108
:class="[
110109
opt.disable ? 'text-faded' : 'cursor-pointer',
111-
index === keyboardIndex ? 'q-select-highlight' : ''
110+
index === keyboardIndex ? 'q-select-highlight' : '',
111+
opt.disable ? '' : 'cursor-pointer'
112112
]"
113113
slot-replace
114114
@click.capture.native="__toggleMultiple(opt.value, opt.disable)"
@@ -139,12 +139,12 @@
139139
<template v-else>
140140
<q-item-wrapper
141141
v-for="(opt, index) in visibleOptions"
142-
:key="JSON.stringify(opt)"
142+
:key="index"
143143
:cfg="opt"
144-
:link="!opt.disable"
145144
:class="[
146145
opt.disable ? 'text-faded' : 'cursor-pointer',
147-
index === keyboardIndex ? 'q-select-highlight' : ''
146+
index === keyboardIndex ? 'q-select-highlight' : '',
147+
opt.disable ? '' : 'cursor-pointer'
148148
]"
149149
slot-replace
150150
:active="value === opt.value"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
body.desktop .q-select-highlight
2-
background rgba(0, 0, 0, .2) !important
2+
background $item-highlight-color !important
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
body.desktop .q-select-highlight
2-
background rgba(0, 0, 0, .2) !important
2+
background $item-highlight-color !important

0 commit comments

Comments
 (0)