Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/util/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export function getDropdownPosition(
const baseLeft = left + input.offsetLeft + DROPDOWN_MARGIN;

// Check for horizontal overflow and adjust if necessary
const adjustedLeft = baseLeft + DROPDOWN_WIDTH > window.innerWidth
? window.innerWidth - DROPDOWN_WIDTH - DROPDOWN_MARGIN
const adjustedLeft = baseLeft + inputRect.left + DROPDOWN_WIDTH > window.innerWidth
? inputRect.width - DROPDOWN_WIDTH - DROPDOWN_MARGIN
: baseLeft;

// Is there place for the dropdown below the caret?
Expand Down