File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -40,15 +40,17 @@ class SelectOptionGroup extends Component {
4040 resetMenuStyle = ( ) => {
4141 if ( ! this . optionGroupRef ) return ;
4242 const { isInModal, position } = this . props ;
43- const { top, height } = this . optionGroupRef . getBoundingClientRect ( ) ;
43+ const { top, height, width } = this . optionGroupRef . getBoundingClientRect ( ) ;
4444 if ( isInModal ) {
4545 if ( position . y + position . height + height > window . innerHeight ) {
4646 this . optionGroupRef . style . top = ( position . y - height ) + 'px' ;
4747 }
48+ if ( position && position . x + width > window . innerWidth ) {
49+ this . optionGroupRef . style . left = ( window . innerWidth - width - 10 ) + 'px' ;
50+ }
4851 this . optionGroupRef . style . opacity = 1 ;
4952 this . searchInputRef . current && this . searchInputRef . current . inputRef . focus ( ) ;
50- }
51- else {
53+ } else {
5254 if ( height + top > window . innerHeight ) {
5355 const borderWidth = 2 ;
5456 this . optionGroupRef . style . top = - 1 * ( height + borderWidth ) + 'px' ;
You can’t perform that action at this time.
0 commit comments