Skip to content

Commit c7b69ff

Browse files
pdanpdanrstoenescu
authored andcommitted
Disabled and tabindex for new inputs in controls (quasarframework#1524)
1 parent 6e936e6 commit c7b69ff

File tree

9 files changed

+158
-111
lines changed

9 files changed

+158
-111
lines changed

dev/components/components/uploader.vue

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,27 @@
3434
<q-uploader style="max-width: 320px" no-thumbnails color="amber" :url="url" />
3535

3636
<q-toggle v-model="inverted" label="Inverted" />
37+
<q-toggle v-model="dark" label="Dark" />
3738
<p class="caption">Multiple File Upload</p>
38-
<q-uploader
39-
:inverted="inverted"
40-
auto-expand
41-
style="max-width: 320px"
42-
float-label="Upload files"
43-
multiple
44-
:url="url"
45-
ref="upld"
46-
@start="emit('start')"
47-
@finish="emit('finish')"
48-
@uploaded="uploaded"
49-
@add="add"
50-
@remove:done="removeDone"
51-
@remove:abort="removeAbort"
52-
@remove:cancel="removeCancel"
53-
/>
39+
<div class="q-pa-sm" :class="this.dark ? 'bg-grey-10 text-orange' : ''">
40+
<q-uploader
41+
:inverted="inverted"
42+
:dark="dark"
43+
auto-expand
44+
style="max-width: 320px"
45+
float-label="Upload files"
46+
multiple
47+
:url="url"
48+
ref="upld"
49+
@start="emit('start')"
50+
@finish="emit('finish')"
51+
@uploaded="uploaded"
52+
@add="add"
53+
@remove:done="removeDone"
54+
@remove:abort="removeAbort"
55+
@remove:cancel="removeCancel"
56+
/>
57+
</div>
5458

5559
<q-btn color="primary" @click="pick" style="margin-top: 15px">Pick Files</q-btn>
5660
<q-btn color="primary" @click="reset" style="margin-top: 15px">Reset the above Uploader</q-btn>
@@ -102,7 +106,7 @@
102106

103107
<div class="absolute-right no-pointer-events">
104108
<q-btn @click="clear" style="pointer-events: all" color="primary">Clear Debug Log</q-btn>
105-
<div v-for="evt in events">
109+
<div v-for="evt in events" :key="evt">
106110
{{evt}}
107111
</div>
108112
</div>
@@ -116,7 +120,8 @@ export default {
116120
return {
117121
url: 'http://1.1.1.195/upload.php',
118122
events: [],
119-
inverted: false
123+
inverted: false,
124+
dark: false
120125
}
121126
},
122127
methods: {

dev/components/form/all.vue

Lines changed: 108 additions & 81 deletions
Large diffs are not rendered by default.

dev/components/form/all2.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,17 @@
6161
<q-chips-input :dark="dark" class="q-my-sm" v-model="chips" float-label="Float Label" clearable suffix="SUF" prefix="PRE" />
6262
<q-chips-input :dark="dark" class="q-my-sm" v-model="chips" placeholder="Placeholder" float-label="With placeholder" clearable suffix="SUF" prefix="PRE" />
6363
<q-chips-input :dark="dark" class="q-my-sm" v-model="chips" placeholder="Placeholder" clearable suffix="SUF" prefix="PRE" />
64-
<q-chips-input :dark="dark" class="q-my-sm" color="amber-2" chips-color="amber-2" chips-bg-color="dark" v-model="chips" stack-label="Stack Label" clearable suffix="SUF" prefix="PRE" />
64+
<q-chips-input :dark="dark" class="q-my-sm" color="amber-2" v-model="chips" stack-label="Stack Label" clearable suffix="SUF" prefix="PRE" />
65+
<q-chips-input :dark="dark" class="q-my-sm" color="amber-2" v-model="chips" stack-label="Stack Label" clearable suffix="SUF" prefix="PRE" />
6566
<q-chips-input :dark="dark" class="q-my-sm" v-model="chips" inverted stack-label="Stack Label" clearable />
6667
<q-chips-input :dark="dark" class="q-my-sm" v-model="chips" inverted stack-label="Stack Label" clearable suffix="SUF" prefix="PRE" />
6768
<q-chips-input :dark="dark" class="q-my-sm" v-model="chips" inverted color="secondary" stack-label="With placeholder" placeholder="Placeholder" clearable suffix="SUF" prefix="PRE" />
6869
<q-chips-input :dark="dark" class="q-my-sm" color="amber-2" v-model="chips" inverted-light stack-label="Stack Label" clearable suffix="SUF" prefix="PRE" />
6970
<q-chips-input :dark="dark" class="q-my-sm" color="amber-2" v-model="chips" inverted-light float-label="With placeholder" placeholder="Placeholder" clearable suffix="SUF" prefix="PRE" />
7071
<q-chips-input :dark="dark" class="q-my-sm" color="white" v-model="chips" inverted-light stack-label="Stack Label" clearable suffix="SUF" prefix="PRE" />
71-
<q-chips-input :dark="dark" class="q-my-sm" inverted color="dark" chips-color="black" chips-bg-color="lime" v-model="chips" stack-label="Stack Label" clearable suffix="SUF" prefix="PRE" />
72+
<q-chips-input :dark="dark" class="q-my-sm" inverted color="grey-10" v-model="chips" stack-label="Stack Label" clearable suffix="SUF" prefix="PRE" />
73+
<q-chips-input :dark="dark" class="q-my-sm" inverted color="orange" v-model="chips" stack-label="Stack Label" clearable suffix="SUF" prefix="PRE" />
74+
<q-chips-input :dark="dark" class="q-my-sm" color="orange" v-model="chips" stack-label="Stack Label" clearable suffix="SUF" prefix="PRE" />
7275
</div>
7376
<q-toggle v-model="dark" label="Dark" class="fixed-top-left bg-grey-5 q-pa-sm" style="top: 18px; left: 18px;" />
7477
</div>

src/components/color/QColor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ export default {
231231
attrs: {
232232
value: this.actualValue,
233233
placeholder: this.inputPlaceholder,
234-
readonly: true
234+
readonly: true,
235+
disabled: this.disable,
236+
tabindex: -1
235237
}
236238
}),
237239

src/components/datetime/QDatetime.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export default {
146146

147147
__getPicker (h, modal) {
148148
return [
149-
h(QFieldReset, [
149+
h(QFieldReset, { staticClass: 'flex' }, [
150150
h(QDatetimePicker, {
151151
ref: 'target',
152152
staticClass: `no-border`,
@@ -246,7 +246,9 @@ export default {
246246
attrs: {
247247
value: this.actualValue,
248248
placeholder: this.inputPlaceholder,
249-
readonly: true
249+
readonly: true,
250+
disabled: this.disable,
251+
tabindex: -1
250252
}
251253
}),
252254

src/components/select/QSelect.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
:value="actualValue"
5858
:placeholder="inputPlaceholder"
5959
readonly
60+
:disabled="this.disable"
61+
tabindex="-1"
6062
/>
6163

6264
<q-icon
@@ -76,7 +78,7 @@
7678
:anchor-click="false"
7779
class="column no-wrap"
7880
:class="dark ? 'bg-dark' : null"
79-
@show="__onFocus"
81+
@show="__onShow"
8082
@hide="__onClose"
8183
>
8284
<q-field-reset>
@@ -350,10 +352,16 @@ export default {
350352
return
351353
}
352354
this.focused = true
355+
this.$emit('focus')
356+
},
357+
__onShow () {
358+
if (this.disable) {
359+
return
360+
}
361+
this.__onFocus()
353362
if (this.filter && this.autofocusFilter) {
354363
this.$refs.filter.focus()
355364
}
356-
this.$emit('focus')
357365
const selected = this.$refs.popover.$el.querySelector(this.activeItemSelector)
358366
if (selected) {
359367
selected.scrollIntoView()
@@ -372,8 +380,8 @@ export default {
372380
}, 1)
373381
},
374382
__onClose () {
375-
this.focused = false
376383
this.terms = ''
384+
this.focused = false
377385
this.$emit('blur')
378386
this.$nextTick(() => {
379387
if (JSON.stringify(this.model) !== JSON.stringify(this.value)) {

src/components/uploader/QUploader.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
:class="alignClass"
3232
:value="label"
3333
readonly
34+
:disabled="this.disable"
35+
tabindex="-1"
3436
/>
3537

3638
<q-spinner

src/css/core/helpers.styl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
display block
1414
background $backdrop-background
1515

16-
.no-border
17-
border 0 !important
18-
.no-outline
19-
outline 0 !important
2016
.round-borders
2117
border-radius $generic-border-radius !important
2218

src/css/core/visibility.styl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
border-radius 0 !important
99
.no-box-shadow
1010
box-shadow none !important
11+
.no-outline
12+
outline 0 !important
1113

1214
.ellipsis
1315
text-overflow ellipsis

0 commit comments

Comments
 (0)