Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 975bae2

Browse files
태재영abhiomkar
authored andcommitted
fix(chips): Fix incorrect ripple effect on filter chip (#4565)
1 parent 968a054 commit 975bae2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/mdc-chips/chip/foundation.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,18 @@ export class MDCChipFoundation extends MDCFoundation<MDCChipAdapter> {
103103
const checkmarkRect = getCheckmarkRect();
104104
if (checkmarkRect) {
105105
const rootRect = getRootRect();
106-
const height = rootRect.height;
107106
// Checkmark is a square, meaning the client rect's width and height are identical once the animation completes.
108107
// However, the checkbox is initially hidden by setting the width to 0.
109108
// To account for an initial width of 0, we use the checkbox's height instead (which equals the end-state width)
110109
// when adding it to the root client rect's width.
111-
const checkmarkWidth = checkmarkRect.height;
112-
const width = rootRect.width + checkmarkWidth;
113-
return {...rootRect, width, height};
110+
return {
111+
bottom: rootRect.bottom,
112+
height: rootRect.height,
113+
left: rootRect.left,
114+
right: rootRect.right,
115+
top: rootRect.top,
116+
width: rootRect.width + checkmarkRect.height,
117+
};
114118
}
115119
}
116120

0 commit comments

Comments
 (0)