From 58e74a9e8bfc36f69103c6a301170c5f6ada03dd Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Wed, 11 Mar 2020 09:55:04 +0800 Subject: [PATCH] feat(Stepper): improve number keyboard --- src/stepper/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/stepper/index.js b/src/stepper/index.js index 8e887cdd4..8f9c9291f 100644 --- a/src/stepper/index.js +++ b/src/stepper/index.js @@ -293,6 +293,10 @@ export default createComponent({ type="number" role="spinbutton" class={bem('input')} + // set keyboard in mordern browers + inputmode={this.integer ? 'numeric' : 'decimal'} + // set keyboard in iOS 8 ~ 12 + pattern={this.integer ? '\\d*' : null} value={this.currentValue} style={this.inputStyle} disabled={this.disabled}