File tree Expand file tree Collapse file tree 1 file changed +7
-17
lines changed
packages/core/src/components/forms Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -129,11 +129,13 @@ export class InputGroup extends AbstractPureComponent2<IInputGroupProps & HTMLIn
129
129
}
130
130
131
131
public componentDidMount ( ) {
132
- this . updateInputWidth ( ) ;
133
- }
134
-
135
- public componentDidUpdate ( ) {
136
- this . updateInputWidth ( ) ;
132
+ if ( this . rightElement != null ) {
133
+ const { clientWidth } = this . rightElement ;
134
+ // small threshold to prevent infinite loops
135
+ if ( Math . abs ( clientWidth - this . state . rightElementWidth ) > 2 ) {
136
+ this . setState ( { rightElementWidth : clientWidth } ) ;
137
+ }
138
+ }
137
139
}
138
140
139
141
private maybeRenderRightElement ( ) {
@@ -147,16 +149,4 @@ export class InputGroup extends AbstractPureComponent2<IInputGroupProps & HTMLIn
147
149
</ span >
148
150
) ;
149
151
}
150
-
151
- private updateInputWidth ( ) {
152
- if ( this . rightElement != null ) {
153
- const { clientWidth } = this . rightElement ;
154
- // small threshold to prevent infinite loops
155
- if ( Math . abs ( clientWidth - this . state . rightElementWidth ) > 2 ) {
156
- this . setState ( { rightElementWidth : clientWidth } ) ;
157
- }
158
- } else {
159
- this . setState ( { rightElementWidth : DEFAULT_RIGHT_ELEMENT_WIDTH } ) ;
160
- }
161
- }
162
152
}
You can’t perform that action at this time.
0 commit comments