Skip to content

Commit 21fd12c

Browse files
chapterjasonclaude
andcommitted
Clear stale preview inline width when popover becomes alts
When a long-press transforms the preview bubble into the alts listbox, #openPopover reused the DOM element but only reset className and children. The inline style.width=anchorWidth from the preview stayed on the node, so the flex container was pinned at key-width while the alt buttons laid out their natural sum — they spilled outside the popover box. #positionPopover now clears the opposite-mode inline size every time it runs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a6f10cf commit 21fd12c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/keyboard/element.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,9 @@ export class VirtualKeyboard extends HTMLElement {
755755
const anchorRect = anchor.getBoundingClientRect();
756756
if (popover.classList.contains("preview")) {
757757
popover.style.width = `${anchorRect.width}px`;
758+
popover.style.minWidth = "";
758759
} else {
760+
popover.style.width = "";
759761
popover.style.minWidth = `${anchorRect.width}px`;
760762
}
761763

0 commit comments

Comments
 (0)