Skip to content

Commit

Permalink
fix(range): 在 delayQuerySelector 时增加 30ms 延迟, close #1021
Browse files Browse the repository at this point in the history
  • Loading branch information
Garfield550 committed Apr 25, 2020
1 parent ebcf943 commit 9f4f025
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/range/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,10 @@ export default class AtRange extends AtComponent<AtRangeProps, AtRangeState> {
}

private updatePos(): void {
delayQuerySelector(this, '.at-range__container', 0)
.then(rect => {
this.width = Math.round(rect[0].width)
this.left = Math.round(rect[0].left)
})
delayQuerySelector(this, '.at-range__container', 30).then(rect => {
this.width = Math.round(rect[0].width)
this.left = Math.round(rect[0].left)
})
}

public componentWillReceiveProps(nextProps: AtRangeProps): void {
Expand Down

0 comments on commit 9f4f025

Please sign in to comment.