Skip to content

Commit 166a932

Browse files
authored
fix(b-form-input, b-form-textarea): handle change event for all mobile device keyboards (closes bootstrap-vue#4724) (bootstrap-vue#4739)
1 parent 623687a commit 166a932

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

src/components/form-input/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,15 @@ rendered and a console warning will be issued.
9494
- Older version of Firefox may not support `readonly` for `range` type inputs.
9595
- Input types that do not support `min`, `max` and `step` (i.e. `text`, `password`, `tel`, `email`,
9696
`url`, etc) will silently ignore these values (although they will still be rendered on the input
97-
markup) iv values are provided.
97+
markup) if values are provided.
98+
99+
**Caveats with predictive text entry and IME composition entry:**
100+
101+
- When using predictive text auto-suggested words, the `v-model` will not update until the
102+
auto-suggested word is selected (or a space is typed). If an auto suggested word is not selected,
103+
the v-model will update with the current _displayed text_ of the input when the input is blurred.
104+
- When using IME composition (ie. Chinese, Japanese, etc), the `v-model` will not update until the
105+
IME composition is completed.
98106

99107
### Range type input
100108

@@ -155,7 +163,7 @@ In the example below, we double the number of steps by using step="0.5".
155163
convert the value to a native number by using `Number(value)`, `parseInt(value, 10)`,
156164
`parseFloat(value)`, or use the `number` prop.
157165

158-
**Note:** Bootstrap v4.1 CSS does not include styling for range inputs inside input groups, nor
166+
**Note:** Bootstrap v4 CSS does not include styling for range inputs inside input groups, nor
159167
validation styling on range inputs. However, BootstrapVue includes custom styling to handle these
160168
situations until styling is included in Bootstrap v4.
161169

src/components/form-radio/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,16 @@ If you want to customize the field property names (for example using `name` fiel
251251

252252
## Radio value and v-model
253253

254-
`<b-form-radio>` and `<b-form-radio-group>` do not have a value by default. You must explicitly
255-
supply a value (to which the `v-model` is set to when the radio is checked) via the `value` prop.
254+
`<b-form-radio>` components do not have a value by default. You must explicitly supply a value via
255+
the `value` prop on `<b-form-radio>`. This value will be sent to the `v-model` when the radio is
256+
checked.
256257

257258
The `v-model` of both `<b-form-radio>` and `<b-form-radio-group>` binds to the `checked` prop. To
258-
pre-check a radio, you must set the `v-model` value to the radio's value. Do not use the `checked`
259-
prop directly.
259+
pre-check a radio, you must set the `v-model` value to the one of the radio's value (i.e. must match
260+
the value of specified on one of the the radio's `value` prop). Do not use the `checked` prop
261+
directly. Each radio in a radio group _must_ have a unique value.
260262

261-
Radio supports values of many types, such as a `string`, `boolean`, `number`, or an `object`.
263+
Radios support values of many types, such as a `string`, `boolean`, `number`, or a plain `object`.
262264

263265
## Inline or stacked radios
264266

src/mixins/form-text.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export default {
182182
// https://github.com/bootstrap-vue/bootstrap-vue/issues/3498
183183
/* istanbul ignore next: hard to test */
184184
const $input = this.$refs.input
185-
/* istanbul ignore if: hard to test outof sync value */
185+
/* istanbul ignore if: hard to test out of sync value */
186186
if ($input && value !== $input.value) {
187187
$input.value = value
188188
}
@@ -191,6 +191,7 @@ export default {
191191
onInput(evt) {
192192
// `evt.target.composing` is set by Vue
193193
// https://github.com/vuejs/vue/blob/dev/src/platforms/web/runtime/directives/model.js
194+
// TODO: Is this needed now with the latest Vue?
194195
/* istanbul ignore if: hard to test composition events */
195196
if (evt.target.composing) {
196197
return
@@ -209,12 +210,6 @@ export default {
209210
this.$emit('input', formattedValue)
210211
},
211212
onChange(evt) {
212-
// `evt.target.composing` is set by Vue
213-
// https://github.com/vuejs/vue/blob/dev/src/platforms/web/runtime/directives/model.js
214-
/* istanbul ignore if: hard to test composition events */
215-
if (evt.target.composing) {
216-
return
217-
}
218213
const value = evt.target.value
219214
const formattedValue = this.formatValue(value, evt)
220215
// Exit when the `formatter` function strictly returned `false`

0 commit comments

Comments
 (0)