This repository was archived by the owner on Apr 17, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 327327 if (el ) {
328328 const { height : inputHeight, top } = el .getBoundingClientRect ();
329329 const fullHeight = window .innerHeight ;
330- const freeSpace = fullHeight - top - inputHeight ;
330+ const freeSpaceBottom = fullHeight - top - inputHeight ;
331+
331332 const menuEl = document .getElementById (` dp__menu_${props .uid } ` );
332333
333334 if (menuEl ) {
334335 const { height } = menuEl .getBoundingClientRect ();
335336 const menuHeight = height + inputHeight ;
336- if (menuHeight > freeSpace ) {
337- menuPosition .value .top = ` ${el .offsetTop - height - 12 }px ` ;
338- openOnTop .value = true ;
337+ if (menuHeight > top && menuHeight > freeSpaceBottom ) {
338+ if (top > freeSpaceBottom ) {
339+ openOnTop .value = true ;
340+ } else {
341+ setMenuPosition (false );
342+ openOnTop .value = false ;
343+ }
339344 } else {
340- setMenuPosition (false );
341- openOnTop .value = false ;
345+ if (menuHeight > freeSpaceBottom ) {
346+ menuPosition .value .top = ` ${el .offsetTop - height - 12 }px ` ;
347+ openOnTop .value = true ;
348+ } else {
349+ setMenuPosition (false );
350+ openOnTop .value = false ;
351+ }
342352 }
343353 }
344354 }
You can’t perform that action at this time.
0 commit comments