From d95914cfff05d5b9e02a21e2a9ccea87d7f4168e Mon Sep 17 00:00:00 2001 From: Application-drop-up Date: Thu, 3 Sep 2026 22:11:40 +0900 Subject: [PATCH 1/2] fix: exclude center-anchored topEdge/bottomEdge from Badge LEFT_PLACEMENTS topEdge and bottomEdge are centered via `left: 50%` + `translateX(-50%)`, but they were also listed in LEFT_PLACEMENTS. Setting horizontalOffset on a badge with one of these placements overwrote `left: 50%` while leaving the translateX(-50%) in place, shifting the badge off-center instead of nudging it from its centered position. RIGHT_PLACEMENTS already excluded both, so this brings LEFT_PLACEMENTS in line with that. --- src/badge/styled-components.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/badge/styled-components.ts b/src/badge/styled-components.ts index e46341438e..fb38bd0543 100644 --- a/src/badge/styled-components.ts +++ b/src/badge/styled-components.ts @@ -209,10 +209,8 @@ const BOTTOM_PLACEMENTS: Placement[] = [ const LEFT_PLACEMENTS: Placement[] = [ PLACEMENT.topLeft, PLACEMENT.topLeftEdge, - PLACEMENT.topEdge, PLACEMENT.bottomLeft, PLACEMENT.bottomLeftEdge, - PLACEMENT.bottomEdge, PLACEMENT.leftTopEdge, PLACEMENT.leftBottomEdge, ]; From 9b26a5bb3bcef36fb2ab25a324e08dadc5644725 Mon Sep 17 00:00:00 2001 From: Application-drop-up Date: Thu, 3 Sep 2026 22:11:46 +0900 Subject: [PATCH 2/2] test: add Badge scenario case for topEdge/bottomEdge with horizontalOffset Visually verifies that horizontalOffset no longer shifts center-anchored topEdge/bottomEdge badges off-center. --- src/badge/__tests__/badge.scenario.tsx | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/badge/__tests__/badge.scenario.tsx b/src/badge/__tests__/badge.scenario.tsx index ee74dc8435..f70c53fbdb 100644 --- a/src/badge/__tests__/badge.scenario.tsx +++ b/src/badge/__tests__/badge.scenario.tsx @@ -137,6 +137,34 @@ export function Scenario() { + +
+ {/* topEdge/bottomEdge are center-anchored (left: 50%, translateX(-50%)). + horizontalOffset should have no effect on them and they should stay + centered, not drift left. See src/badge/styled-components.ts LEFT_PLACEMENTS. */} + + +
topEdge
+
horizontalOffset: 20px (should stay centered)
+
+
+ + +
bottomEdge
+
horizontalOffset: 20px (should stay centered)
+
+
+
); }