kopia lustrzana https://github.com/manuelkasper/sotlas-frontend
Attempt to fix frequency comma input problem in some locales
rodzic
c189ce901d
commit
e5953ab584
|
@ -19,7 +19,7 @@
|
|||
|
||||
<b-field label="Frequency" :message="maybeKhz ? 'Do you really mean ' + frequency + ' MHz, or are you missing a dot?' : ''" :type="maybeKhz ? 'is-warning' : ''">
|
||||
<b-field :type="maybeKhz ? 'is-warning' : ''">
|
||||
<b-input v-model="frequency" type="number" inputmode="decimal" step="any" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" required />
|
||||
<FrequencyInput v-model="frequency" />
|
||||
<p class="control">
|
||||
<span class="button is-static">MHz</span>
|
||||
</p>
|
||||
|
@ -49,10 +49,11 @@ import utils from '../mixins/utils.js'
|
|||
import prefs from '../mixins/prefs.js'
|
||||
import sotawatch from '../mixins/sotawatch.js'
|
||||
import NearbySummitsList from './NearbySummitsList.vue'
|
||||
import FrequencyInput from './FrequencyInput.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
NearbySummitsList
|
||||
NearbySummitsList, FrequencyInput
|
||||
},
|
||||
mixins: [utils, prefs, sotawatch],
|
||||
props: {
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<template>
|
||||
<b-input :value="value" type="number" inputmode="decimal" lang="en_EN" step="any" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" required @keydown.native="frequencyKeydown" @input="updateValue" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
value: String
|
||||
},
|
||||
methods: {
|
||||
updateValue (value) {
|
||||
this.$emit('input', value)
|
||||
},
|
||||
frequencyKeydown (event) {
|
||||
if (event.keyCode === 188) {
|
||||
event.target.value += '.'
|
||||
event.preventDefault()
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Ładowanie…
Reference in New Issue