Skip to content

Commit 6cebc83

Browse files
committed
fix
1 parent f024ecd commit 6cebc83

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/terminal/terminalTouchSelection.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,14 @@ export default class TerminalTouchSelection {
944944

945945
menuX = centerX - menuWidth / 2;
946946
menuY = baseY + this.cellDimensions.height + 40;
947+
948+
// If menu would overflow below, prefer placing it above selection.
949+
const maxY = containerRect.height - menuHeight - 10;
950+
if (menuY > maxY) {
951+
const topY =
952+
startPos && endPos ? Math.min(startPos.y, endPos.y) : baseY;
953+
menuY = topY - menuHeight - 10;
954+
}
947955
} else {
948956
menuX = (containerRect.width - menuWidth) / 2;
949957
menuY = containerRect.height - menuHeight - 20;

0 commit comments

Comments
 (0)