File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 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> {
155155 left +
156156 dropdownBounds . width ;
157157
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+ }
167168
168- if ( dropdownBottom > containerBounds . bottom ) {
169+ if ( dropdownBottom > containerBounds . bottom &&
170+ textareaBounds . top + top > dropdownBounds . height ) {
169171 topPosition = top - dropdownBounds . height ;
170172 usedClasses . push ( POSITION_CONFIGURATION . Y . TOP ) ;
171173 unusedClasses . push ( POSITION_CONFIGURATION . Y . BOTTOM ) ;
You can’t perform that action at this time.
0 commit comments