File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -155,17 +155,19 @@ class Autocomplete extends React.Component<AutocompleteProps> {
155
155
left +
156
156
dropdownBounds . width ;
157
157
158
- if ( dropdownRight > containerBounds . right ) {
159
- leftPosition = left - dropdownBounds . width ;
160
- usedClasses . push ( POSITION_CONFIGURATION . X . LEFT ) ;
161
- unusedClasses . push ( POSITION_CONFIGURATION . X . RIGHT ) ;
162
- } else {
163
- leftPosition = left ;
164
- usedClasses . push ( POSITION_CONFIGURATION . X . RIGHT ) ;
165
- unusedClasses . push ( POSITION_CONFIGURATION . X . LEFT ) ;
166
- }
158
+ if ( dropdownRight > containerBounds . right &&
159
+ textareaBounds . left + left > dropdownBounds . width ) {
160
+ leftPosition = left - dropdownBounds . width ;
161
+ usedClasses . push ( POSITION_CONFIGURATION . X . LEFT ) ;
162
+ unusedClasses . push ( POSITION_CONFIGURATION . X . RIGHT ) ;
163
+ } else {
164
+ leftPosition = left ;
165
+ usedClasses . push ( POSITION_CONFIGURATION . X . RIGHT ) ;
166
+ unusedClasses . push ( POSITION_CONFIGURATION . X . LEFT ) ;
167
+ }
167
168
168
- if ( dropdownBottom > containerBounds . bottom ) {
169
+ if ( dropdownBottom > containerBounds . bottom &&
170
+ textareaBounds . top + top > dropdownBounds . height ) {
169
171
topPosition = top - dropdownBounds . height ;
170
172
usedClasses . push ( POSITION_CONFIGURATION . Y . TOP ) ;
171
173
unusedClasses . push ( POSITION_CONFIGURATION . Y . BOTTOM ) ;
You can’t perform that action at this time.
0 commit comments