fix(Stepper): readonly not work in lagacy mobile safari (#5976)

This commit is contained in:
neverland 2020-04-01 18:15:23 +08:00 committed by GitHub
parent cbe136ebdd
commit 537e80e37a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -315,7 +315,7 @@ export default createComponent({
this.focused = true; this.focused = true;
this.$emit('focus', event); this.$emit('focus', event);
// hack for safari // readonly not work in lagacy mobile safari
/* istanbul ignore if */ /* istanbul ignore if */
if (this.readonly) { if (this.readonly) {
this.blur(); this.blur();

View File

@ -208,6 +208,12 @@ export default createComponent({
onFocus(event) { onFocus(event) {
this.$emit('focus', event); this.$emit('focus', event);
// readonly not work in lagacy mobile safari
/* istanbul ignore if */
if (this.disableInput && this.$refs.input) {
this.$refs.input.blur();
}
}, },
onBlur(event) { onBlur(event) {
@ -280,6 +286,7 @@ export default createComponent({
{...createListeners('minus')} {...createListeners('minus')}
/> />
<input <input
ref="input"
type={this.integer ? 'tel' : 'text'} type={this.integer ? 'tel' : 'text'}
role="spinbutton" role="spinbutton"
class={bem('input')} class={bem('input')}