Skip to content

Commit ebf24bc

Browse files
committed
fix TimePicker cause jump occasionally
ant-design/ant-design#19698 (comment)
1 parent f45197a commit ebf24bc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ coverage
2929
yarn.lock
3030
es/
3131
package-lock.json
32-
src/*.js
3332
src/*.map
3433
.prettierrc
3534
tslint.json

src/Header.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ class Header extends Component {
2222
// requestAnimationFrame will cause jump on rc-trigger 3.x
2323
// https://github.com/ant-design/ant-design/pull/19698#issuecomment-552889571
2424
// use setTimeout can resolve it
25+
// 60ms is a magic timeout to avoid focusing before dropdown reposition correctly
2526
this.timeout = setTimeout(() => {
2627
this.refInput.focus();
2728
this.refInput.select();
28-
});
29+
}, 60);
2930
}
3031
}
3132

0 commit comments

Comments
 (0)