Skip to content

Commit a3f17c3

Browse files
author
frankqian
authored
fix(Select): AutoComplete input focus selectionStart close #1913 (#1921)
1 parent 7324ca9 commit a3f17c3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/input/base.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,10 @@ class Base extends React.Component {
294294

295295
focus(start, end) {
296296
this.inputRef.focus();
297-
if (typeof start !== 'undefined') {
297+
if (typeof start === 'number') {
298298
this.inputRef.selectionStart = start;
299299
}
300-
if (typeof end !== 'undefined') {
300+
if (typeof end === 'number') {
301301
this.inputRef.selectionEnd = end;
302302
}
303303
}

src/select/base.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,12 @@ export default class Base extends React.Component {
561561
* 点击 arrow 或 label 的时候焦点切到 input 中
562562
* @override
563563
*/
564-
focusInput(...args) {
565-
this.inputRef.focus(...args);
564+
focusInput() {
565+
this.inputRef.focus();
566566
}
567567

568568
focus(...args) {
569-
this.focusInput(...args);
569+
this.inputRef.focus(...args);
570570
}
571571

572572
beforeOpen() {

0 commit comments

Comments
 (0)