fix: input-number uphandle cannot click
parent
8370c16df9
commit
a19beced12
|
@ -1 +1 @@
|
|||
Subproject commit e58ddcdb3436fbf430e69953053d73114ce6ce6b
|
||||
Subproject commit bda092900405709ab19219754c43d68975a143be
|
|
@ -38,6 +38,15 @@ const InputNumber = {
|
|||
configProvider: inject('configProvider', ConfigConsumerProps),
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
if (this.autofocus && !this.disabled) {
|
||||
this.focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
saveInputNumber(inputNumberRef) {
|
||||
this.inputNumberRef = inputNumberRef;
|
||||
|
|
|
@ -6,8 +6,6 @@ import classNames from 'classnames';
|
|||
import KeyCode from '../../_util/KeyCode';
|
||||
import InputHandler from './InputHandler';
|
||||
|
||||
function noop() {}
|
||||
|
||||
function preventDefault(e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
@ -77,6 +75,7 @@ const inputNumberProps = {
|
|||
name: PropTypes.string,
|
||||
id: PropTypes.string,
|
||||
type: PropTypes.string,
|
||||
maxlength: PropTypes.any,
|
||||
};
|
||||
|
||||
export default {
|
||||
|
@ -115,9 +114,6 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
if (this.autofocus && !this.disabled) {
|
||||
this.focus();
|
||||
}
|
||||
this.updatedFunc();
|
||||
});
|
||||
},
|
||||
|
@ -691,21 +687,21 @@ export default {
|
|||
let downEvents;
|
||||
if (useTouch) {
|
||||
upEvents = {
|
||||
onTouchstart: editable && !upDisabledClass ? this.up : noop,
|
||||
onTouchstart: editable && !upDisabledClass && this.up,
|
||||
onTouchend: this.stop,
|
||||
};
|
||||
downEvents = {
|
||||
onTouchstart: editable && !downDisabledClass ? this.down : noop,
|
||||
onTouchstart: editable && !downDisabledClass && this.down,
|
||||
onTouchend: this.stop,
|
||||
};
|
||||
} else {
|
||||
upEvents = {
|
||||
onMousedown: editable && !upDisabledClass ? this.up : noop,
|
||||
onMousedown: editable && !upDisabledClass && this.up,
|
||||
onMouseup: this.stop,
|
||||
onMouseleave: this.stop,
|
||||
};
|
||||
downEvents = {
|
||||
onMousedown: editable && !downDisabledClass ? this.down : noop,
|
||||
onMousedown: editable && !downDisabledClass && this.down,
|
||||
onMouseup: this.stop,
|
||||
onMouseleave: this.stop,
|
||||
};
|
||||
|
@ -735,7 +731,6 @@ export default {
|
|||
...downEvents,
|
||||
ref: this.saveDown,
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
class={classes}
|
||||
|
@ -747,16 +742,18 @@ export default {
|
|||
onMouseout={props.onMouseout}
|
||||
>
|
||||
<div class={`${prefixCls}-handler-wrap`}>
|
||||
<InputHandler {...upHandlerProps}>
|
||||
{upHandler || (
|
||||
<span
|
||||
unselectable="unselectable"
|
||||
class={`${prefixCls}-handler-up-inner`}
|
||||
onClick={preventDefault}
|
||||
/>
|
||||
)}
|
||||
</InputHandler>
|
||||
<InputHandler {...downHandlerProps}>
|
||||
<span>
|
||||
<InputHandler {...upHandlerProps} key="upHandler">
|
||||
{upHandler || (
|
||||
<span
|
||||
unselectable="unselectable"
|
||||
class={`${prefixCls}-handler-up-inner`}
|
||||
onClick={preventDefault}
|
||||
/>
|
||||
)}
|
||||
</InputHandler>
|
||||
</span>
|
||||
<InputHandler {...downHandlerProps} key="downHandler">
|
||||
{downHandler || (
|
||||
<span
|
||||
unselectable="unselectable"
|
||||
|
@ -781,8 +778,10 @@ export default {
|
|||
autocomplete={autocomplete}
|
||||
onFocus={this.onFocus}
|
||||
onBlur={this.onBlur}
|
||||
onKeydown={editable ? this.onKeyDown : noop}
|
||||
onKeyup={editable ? this.onKeyUp : noop}
|
||||
onKeydown={editable && this.onKeyDown}
|
||||
onKeyup={editable && this.onKeyUp}
|
||||
autofocus={this.autofocus}
|
||||
maxlength={this.maxlength}
|
||||
readonly={this.readonly}
|
||||
disabled={this.disabled}
|
||||
max={this.max}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import demo from '../antdv-demo/docs/input/demo/textarea';
|
||||
import demo from '../antdv-demo/docs/input-number/demo/index';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
"@commitlint/config-conventional": "^8.0.0",
|
||||
"@octokit/rest": "^16.0.0",
|
||||
"@vue/cli-plugin-eslint": "^4.0.0",
|
||||
"@vue/compiler-sfc": "^3.0.0-rc.4",
|
||||
"@vue/compiler-sfc": "^3.0.0-rc.5",
|
||||
"@vue/server-test-utils": "1.0.0-beta.16",
|
||||
"@vue/test-utils": "^2.0.0-beta.0",
|
||||
"acorn": "^7.0.0",
|
||||
|
@ -154,7 +154,7 @@
|
|||
"through2": "^3.0.0",
|
||||
"typescript": "^3.9.7",
|
||||
"url-loader": "^3.0.0",
|
||||
"vue": "^3.0.0-rc.4",
|
||||
"vue": "^3.0.0-rc.5",
|
||||
"vue-antd-md-loader": "^1.1.0",
|
||||
"vue-clipboard2": "0.3.1",
|
||||
"vue-draggable-resizable": "^2.1.0",
|
||||
|
|
Loading…
Reference in New Issue