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

Commit 229e590

Browse files
author
Matty Goo
authored
fix(ripple): use default computeBoundingRect for all components with ripple (#2216)
1 parent 8c476e2 commit 229e590

File tree

3 files changed

+0
-36
lines changed

3 files changed

+0
-36
lines changed

packages/mdc-checkbox/index.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,6 @@ class MDCCheckbox extends MDCComponent {
6363
isSurfaceActive: () => this.nativeCb_[MATCHES](':active'),
6464
registerInteractionHandler: (type, handler) => this.nativeCb_.addEventListener(type, handler),
6565
deregisterInteractionHandler: (type, handler) => this.nativeCb_.removeEventListener(type, handler),
66-
computeBoundingRect: () => {
67-
const {left, top} = this.root_.getBoundingClientRect();
68-
const DIM = 40;
69-
return {
70-
top,
71-
left,
72-
right: left + DIM,
73-
bottom: top + DIM,
74-
width: DIM,
75-
height: DIM,
76-
};
77-
},
7866
});
7967
const foundation = new MDCRippleFoundation(adapter);
8068
return new MDCRipple(this.root_, foundation);

packages/mdc-icon-toggle/index.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,6 @@ class MDCIconToggle extends MDCComponent {
4949
const adapter = Object.assign(MDCRipple.createAdapter(this), {
5050
isUnbounded: () => true,
5151
isSurfaceActive: () => this.foundation_.isKeyboardActivated(),
52-
computeBoundingRect: () => {
53-
const dim = 48;
54-
const {left, top} = this.root_.getBoundingClientRect();
55-
return {
56-
left,
57-
top,
58-
width: dim,
59-
height: dim,
60-
right: left + dim,
61-
bottom: left + dim,
62-
};
63-
},
6452
});
6553
const foundation = new MDCRippleFoundation(adapter);
6654
return new MDCRipple(this.root_, foundation);

packages/mdc-radio/index.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,6 @@ class MDCRadio extends MDCComponent {
8585
isSurfaceActive: () => false,
8686
registerInteractionHandler: (type, handler) => this.nativeControl_.addEventListener(type, handler),
8787
deregisterInteractionHandler: (type, handler) => this.nativeControl_.removeEventListener(type, handler),
88-
computeBoundingRect: () => {
89-
const {left, top} = this.root_.getBoundingClientRect();
90-
const DIM = 40;
91-
return {
92-
top,
93-
left,
94-
right: left + DIM,
95-
bottom: top + DIM,
96-
width: DIM,
97-
height: DIM,
98-
};
99-
},
10088
});
10189
const foundation = new MDCRippleFoundation(adapter);
10290
return new MDCRipple(this.root_, foundation);

0 commit comments

Comments
 (0)