mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 08:31:49 +00:00
fix(autocomplete): make popup panels border-box for exact width clamp
Codex P2: the panel maxWidth constants used by the horizontal clamp's totalWidth excluded each panel's padding + border (inline styles default to content-box), so a padded detail tooltip at its 280px max could still render wider than reserved and spill off-screen. Set box-sizing: border-box on the shared panel style so every maxWidth is the true outer width and totalWidth is exact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
014d7b4d39
commit
a8f9fd7a56
1 file changed
+4
@@ -273,6 +273,10 @@ const AutocompletePopup: React.FC<AutocompletePopupProps> = ({
|
||||
const clampedLeft = placement.left;
|
||||
|
||||
const sharedBoxStyle = {
|
||||
// border-box so each panel's maxWidth is its true outer width (padding +
|
||||
// border included). The horizontal clamp's totalWidth sums these maxWidths,
|
||||
// so this keeps the off-screen math exact even for the padded detail panel.
|
||||
boxSizing: "border-box" as const,
|
||||
backgroundColor: popupBg,
|
||||
border: `1px solid ${popupBorder}`,
|
||||
borderRadius: "6px",
|
||||
|
||||
Reference in new issue
Block a user