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.
12 lines
447 B
JavaScript
12 lines
447 B
JavaScript
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);
|
|
});
|