File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,17 @@ export default class AtRange extends AtComponent<AtRangeProps, AtRangeState> {
99
99
}
100
100
}
101
101
102
+ 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
+ } )
108
+ }
109
+
102
110
public componentWillReceiveProps ( nextProps : AtRangeProps ) : void {
103
111
const { value } = nextProps
112
+ this . updatePos ( )
104
113
if (
105
114
this . props . value ! [ 0 ] !== value ! [ 0 ] ||
106
115
this . props . value ! [ 1 ] !== value ! [ 1 ]
@@ -111,13 +120,8 @@ export default class AtRange extends AtComponent<AtRangeProps, AtRangeState> {
111
120
112
121
public componentDidMount ( ) : void {
113
122
const { value } = this . props
114
- delayQuerySelector ( this , '.at-range__container' , 0 ) . then ( rect => {
115
- this . width = Math . round ( rect [ 0 ] . width )
116
- this . left = Math . round ( rect [ 0 ] . left )
117
- this . setValue ( value ! )
118
- } )
119
- // this.triggerEvent('onChange')
120
- // this.triggerEvent('onAfterChange')
123
+ this . updatePos ( )
124
+ this . setValue ( value ! )
121
125
}
122
126
123
127
public render ( ) : JSX . Element {
You can’t perform that action at this time.
0 commit comments