Skip to content

Commit 51ca5fe

Browse files
committed
fix: stepper input mode in wechat
1 parent 05c5f60 commit 51ca5fe

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/Stepper/index.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Component, triggerEvent, getValueFromProps } from '../_util/simply';
1+
import mixinValue from '../mixins/value';
2+
import { Component, getValueFromProps, triggerEvent } from '../_util/simply';
23
import { StepperDefaultProps } from './props';
34
import { getPrecision, getValidNumber } from './utils';
4-
import mixinValue from '../mixins/value';
55

66
Component(
77
StepperDefaultProps,
@@ -11,7 +11,11 @@ Component(
1111
triggerEvent(this, 'focus', value === '' ? null : Number(value), e);
1212
},
1313
onChange(val, e) {
14-
const { needUpdate, value } = this.update(val);
14+
let curVal = val;
15+
/// #if WECHAT
16+
curVal = val.detail;
17+
/// #endif
18+
const { needUpdate, value } = this.update(curVal);
1519
if (getValueFromProps(this, 'onChange') && needUpdate) {
1620
triggerEvent(this, 'change', value === '' ? null : Number(value), e);
1721
}

src/Stepper/props.ts

+5
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,9 @@ export const StepperDefaultProps: Partial<IStepperProps> = {
103103
inputStyle: '',
104104
disabled: false,
105105
inputReadOnly: false,
106+
onChange: null,
107+
onConfirm: null,
108+
onFocus: null,
109+
onBlur: null,
110+
onDisabledTap: null,
106111
};

0 commit comments

Comments
 (0)