File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
src/LiveDevelopment/BrowserScripts Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -2059,8 +2059,26 @@ function RemoteFunctions(config = {}) {
20592059 topPos = offset . top ;
20602060 leftPos = leftSideLeft ;
20612061 } else {
2062- // Last resort: Above element (above options box)
2063- // Will be positioned above options box by checking overlap later
2062+ // Last resort: Try above options box, then above element
2063+ // First, try to position above options box
2064+ let aboveOptionsBoxPos = null ;
2065+
2066+ if ( _nodeMoreOptionsBox && _nodeMoreOptionsBox . _shadow ) {
2067+ const optionsBox = _nodeMoreOptionsBox . _shadow . querySelector ( '.phoenix-more-options-box' ) ;
2068+ if ( optionsBox ) {
2069+ const optionsOffset = _screenOffset ( optionsBox ) ;
2070+ aboveOptionsBoxPos = optionsOffset . top - boxDimensions . height - MARGIN ;
2071+
2072+ // Check if it fits in viewport
2073+ if ( aboveOptionsBoxPos >= viewportTop + MARGIN ) {
2074+ topPos = aboveOptionsBoxPos ;
2075+ leftPos = offset . left ;
2076+ return { topPos, leftPos} ;
2077+ }
2078+ }
2079+ }
2080+
2081+ // If above options box doesn't fit, try above element
20642082 topPos = offset . top - boxDimensions . height - MARGIN ;
20652083 leftPos = offset . left ;
20662084
You can’t perform that action at this time.
0 commit comments