Watch
0
0
Fork
You've already forked hyperhive
0

shared: a dropdown that would run past the window's right edge hangs from the right of its trigger

The state menu on an agent card that fills the width hung from the
trigger's left edge, so the window cut the list off. The list now measures
itself when it opens and flips to the trigger's right edge when it would
overflow.
This commit is contained in:
iris 2026-11-27 16:56:35 +01:00 • committed by mara
commit 608eb9dcd9

View file

@ -0,0 +1,12 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import { hangsFromEnd } from "../../shared/src/dropdown/edge.ts";
test("a list that ends inside the window stays hung from the left", () => {
assert.equal(hangsFromEnd(300, 1000), false);
assert.equal(hangsFromEnd(1000, 1000), false);
});
test("a list that ends past the window edge hangs from the right", () => {
assert.equal(hangsFromEnd(1001, 1000), true);
});