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