Skip to content

Commit 9f4f025

Browse files
committed
fix(range): 在 delayQuerySelector 时增加 30ms 延迟, close #1021
1 parent ebcf943 commit 9f4f025

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/components/range/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,10 @@ export default class AtRange extends AtComponent<AtRangeProps, AtRangeState> {
100100
}
101101

102102
private updatePos(): void {
103-
delayQuerySelector(this, '.at-range__container', 0)
104-
.then(rect => {
105-
this.width = Math.round(rect[0].width)
106-
this.left = Math.round(rect[0].left)
107-
})
103+
delayQuerySelector(this, '.at-range__container', 30).then(rect => {
104+
this.width = Math.round(rect[0].width)
105+
this.left = Math.round(rect[0].left)
106+
})
108107
}
109108

110109
public componentWillReceiveProps(nextProps: AtRangeProps): void {

0 commit comments

Comments
 (0)