Skip to content

Commit 97ec228

Browse files
authored
refactor(material-experimental/mdc-list): account for mdc-list handleClick signature change (#24076)
Accounts for the mdc-list handleClick signature/semantics change as with: material-components/material-components-web#7443.
1 parent 723b77a commit 97ec228

File tree

4 files changed

+674
-656
lines changed

4 files changed

+674
-656
lines changed

package.json

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"@types/google.maps": "^3.45.6",
6161
"@types/youtube": "^0.0.42",
6262
"core-js-bundle": "^3.8.2",
63-
"material-components-web": "14.0.0-canary.1af7c1c4a.0",
63+
"material-components-web": "14.0.0-canary.7d8ea4624.0",
6464
"rxjs": "^6.6.7",
6565
"rxjs-tslint-rules": "^4.33.1",
6666
"tslib": "^2.3.0",
@@ -92,53 +92,53 @@
9292
"@bazel/terser": "4.4.5",
9393
"@bazel/typescript": "4.4.5",
9494
"@firebase/app-types": "^0.6.1",
95-
"@material/animation": "14.0.0-canary.1af7c1c4a.0",
96-
"@material/auto-init": "14.0.0-canary.1af7c1c4a.0",
97-
"@material/banner": "14.0.0-canary.1af7c1c4a.0",
98-
"@material/base": "14.0.0-canary.1af7c1c4a.0",
99-
"@material/button": "14.0.0-canary.1af7c1c4a.0",
100-
"@material/card": "14.0.0-canary.1af7c1c4a.0",
101-
"@material/checkbox": "14.0.0-canary.1af7c1c4a.0",
102-
"@material/chips": "14.0.0-canary.1af7c1c4a.0",
103-
"@material/circular-progress": "14.0.0-canary.1af7c1c4a.0",
104-
"@material/data-table": "14.0.0-canary.1af7c1c4a.0",
105-
"@material/density": "14.0.0-canary.1af7c1c4a.0",
106-
"@material/dialog": "14.0.0-canary.1af7c1c4a.0",
107-
"@material/dom": "14.0.0-canary.1af7c1c4a.0",
108-
"@material/drawer": "14.0.0-canary.1af7c1c4a.0",
109-
"@material/elevation": "14.0.0-canary.1af7c1c4a.0",
110-
"@material/fab": "14.0.0-canary.1af7c1c4a.0",
111-
"@material/feature-targeting": "14.0.0-canary.1af7c1c4a.0",
112-
"@material/floating-label": "14.0.0-canary.1af7c1c4a.0",
113-
"@material/form-field": "14.0.0-canary.1af7c1c4a.0",
114-
"@material/icon-button": "14.0.0-canary.1af7c1c4a.0",
115-
"@material/image-list": "14.0.0-canary.1af7c1c4a.0",
116-
"@material/layout-grid": "14.0.0-canary.1af7c1c4a.0",
117-
"@material/line-ripple": "14.0.0-canary.1af7c1c4a.0",
118-
"@material/linear-progress": "14.0.0-canary.1af7c1c4a.0",
119-
"@material/list": "14.0.0-canary.1af7c1c4a.0",
120-
"@material/menu": "14.0.0-canary.1af7c1c4a.0",
121-
"@material/menu-surface": "14.0.0-canary.1af7c1c4a.0",
122-
"@material/notched-outline": "14.0.0-canary.1af7c1c4a.0",
123-
"@material/radio": "14.0.0-canary.1af7c1c4a.0",
124-
"@material/ripple": "14.0.0-canary.1af7c1c4a.0",
125-
"@material/rtl": "14.0.0-canary.1af7c1c4a.0",
126-
"@material/segmented-button": "14.0.0-canary.1af7c1c4a.0",
127-
"@material/select": "14.0.0-canary.1af7c1c4a.0",
128-
"@material/shape": "14.0.0-canary.1af7c1c4a.0",
129-
"@material/slider": "14.0.0-canary.1af7c1c4a.0",
130-
"@material/snackbar": "14.0.0-canary.1af7c1c4a.0",
131-
"@material/switch": "14.0.0-canary.1af7c1c4a.0",
132-
"@material/tab": "14.0.0-canary.1af7c1c4a.0",
133-
"@material/tab-bar": "14.0.0-canary.1af7c1c4a.0",
134-
"@material/tab-indicator": "14.0.0-canary.1af7c1c4a.0",
135-
"@material/tab-scroller": "14.0.0-canary.1af7c1c4a.0",
136-
"@material/textfield": "14.0.0-canary.1af7c1c4a.0",
137-
"@material/theme": "14.0.0-canary.1af7c1c4a.0",
138-
"@material/tooltip": "14.0.0-canary.1af7c1c4a.0",
139-
"@material/top-app-bar": "14.0.0-canary.1af7c1c4a.0",
140-
"@material/touch-target": "14.0.0-canary.1af7c1c4a.0",
141-
"@material/typography": "14.0.0-canary.1af7c1c4a.0",
95+
"@material/animation": "14.0.0-canary.7d8ea4624.0",
96+
"@material/auto-init": "14.0.0-canary.7d8ea4624.0",
97+
"@material/banner": "14.0.0-canary.7d8ea4624.0",
98+
"@material/base": "14.0.0-canary.7d8ea4624.0",
99+
"@material/button": "14.0.0-canary.7d8ea4624.0",
100+
"@material/card": "14.0.0-canary.7d8ea4624.0",
101+
"@material/checkbox": "14.0.0-canary.7d8ea4624.0",
102+
"@material/chips": "14.0.0-canary.7d8ea4624.0",
103+
"@material/circular-progress": "14.0.0-canary.7d8ea4624.0",
104+
"@material/data-table": "14.0.0-canary.7d8ea4624.0",
105+
"@material/density": "14.0.0-canary.7d8ea4624.0",
106+
"@material/dialog": "14.0.0-canary.7d8ea4624.0",
107+
"@material/dom": "14.0.0-canary.7d8ea4624.0",
108+
"@material/drawer": "14.0.0-canary.7d8ea4624.0",
109+
"@material/elevation": "14.0.0-canary.7d8ea4624.0",
110+
"@material/fab": "14.0.0-canary.7d8ea4624.0",
111+
"@material/feature-targeting": "14.0.0-canary.7d8ea4624.0",
112+
"@material/floating-label": "14.0.0-canary.7d8ea4624.0",
113+
"@material/form-field": "14.0.0-canary.7d8ea4624.0",
114+
"@material/icon-button": "14.0.0-canary.7d8ea4624.0",
115+
"@material/image-list": "14.0.0-canary.7d8ea4624.0",
116+
"@material/layout-grid": "14.0.0-canary.7d8ea4624.0",
117+
"@material/line-ripple": "14.0.0-canary.7d8ea4624.0",
118+
"@material/linear-progress": "14.0.0-canary.7d8ea4624.0",
119+
"@material/list": "14.0.0-canary.7d8ea4624.0",
120+
"@material/menu": "14.0.0-canary.7d8ea4624.0",
121+
"@material/menu-surface": "14.0.0-canary.7d8ea4624.0",
122+
"@material/notched-outline": "14.0.0-canary.7d8ea4624.0",
123+
"@material/radio": "14.0.0-canary.7d8ea4624.0",
124+
"@material/ripple": "14.0.0-canary.7d8ea4624.0",
125+
"@material/rtl": "14.0.0-canary.7d8ea4624.0",
126+
"@material/segmented-button": "14.0.0-canary.7d8ea4624.0",
127+
"@material/select": "14.0.0-canary.7d8ea4624.0",
128+
"@material/shape": "14.0.0-canary.7d8ea4624.0",
129+
"@material/slider": "14.0.0-canary.7d8ea4624.0",
130+
"@material/snackbar": "14.0.0-canary.7d8ea4624.0",
131+
"@material/switch": "14.0.0-canary.7d8ea4624.0",
132+
"@material/tab": "14.0.0-canary.7d8ea4624.0",
133+
"@material/tab-bar": "14.0.0-canary.7d8ea4624.0",
134+
"@material/tab-indicator": "14.0.0-canary.7d8ea4624.0",
135+
"@material/tab-scroller": "14.0.0-canary.7d8ea4624.0",
136+
"@material/textfield": "14.0.0-canary.7d8ea4624.0",
137+
"@material/theme": "14.0.0-canary.7d8ea4624.0",
138+
"@material/tooltip": "14.0.0-canary.7d8ea4624.0",
139+
"@material/top-app-bar": "14.0.0-canary.7d8ea4624.0",
140+
"@material/touch-target": "14.0.0-canary.7d8ea4624.0",
141+
"@material/typography": "14.0.0-canary.7d8ea4624.0",
142142
"@octokit/rest": "18.3.5",
143143
"@rollup/plugin-commonjs": "^21.0.0",
144144
"@rollup/plugin-node-resolve": "^13.0.5",

packages.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# all in-sync. This map is passed to each ng_package rule to stamp out the appropriate
33
# version for the placeholders.
44
ANGULAR_PACKAGE_VERSION = "^13.0.0 || ^14.0.0-0"
5-
MDC_PACKAGE_VERSION = "14.0.0-canary.1af7c1c4a.0"
5+
MDC_PACKAGE_VERSION = "14.0.0-canary.7d8ea4624.0"
66
TSLIB_PACKAGE_VERSION = "^2.3.0"
77
RXJS_PACKAGE_VERSION = "^6.5.3 || ^7.4.0"
88

src/material-experimental/mdc-list/interactive-list-base.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@ export abstract class MatInteractiveListBase<T extends MatListItemBase>
3232
}
3333

3434
_handleClick(event: MouseEvent) {
35-
// The `toggleCheckbox` parameter can always be `true` as it only has an effect if the list
36-
// is recognized as checkbox selection list. For such lists, we would always want to toggle
37-
// the checkbox on list item click. MDC added this parameter so that they can avoid dispatching
38-
// a fake `change` event when the checkbox is directly clicked for the list item. We don't
39-
// need this as we require such list item checkboxes to stop propagation of the change event.
35+
// The `isCheckboxAlreadyUpdatedInAdapter` parameter can always be `false` as it only has an
36+
// effect if the list is recognized as checkbox selection list. For such lists, we would
37+
// always want to toggle the checkbox on list item click. MDC added this parameter so that
38+
// they can avoid dispatching a fake `change` event when the checkbox is directly clicked
39+
// for the list item. We don't need this as we do not have an underlying native checkbox
40+
// that is reachable by users through interaction.
4041
// https://github.com/material-components/material-components-web/blob/08ca4d0ec5f359bc3a20bd2a302fa6b733b5e135/packages/mdc-list/component.ts#L308-L310
4142
this._foundation.handleClick(
4243
this._indexForElement(event.target as HTMLElement),
43-
/* toggleCheckbox */ true,
44+
/* isCheckboxAlreadyUpdatedInAdapter */ false,
4445
);
4546
}
4647

@@ -217,6 +218,7 @@ export function getInteractiveListAdapter(
217218
isCheckboxCheckedAtIndex(index: number) {
218219
return false;
219220
},
221+
notifySelectionChange() {},
220222
notifyAction() {},
221223
};
222224
}

0 commit comments

Comments
 (0)