Skip to content

Commit

Permalink
fix(material-experimental/mdc-list): update material-components-web to
Browse files Browse the repository at this point in the history
pick up multi-select list keyboard support
  • Loading branch information
mmalerba committed Feb 4, 2022
1 parent cff93c8 commit a392616
Show file tree
Hide file tree
Showing 4 changed files with 671 additions and 668 deletions.
96 changes: 48 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@angular/platform-browser": "13.2.0",
"@types/google.maps": "^3.47.3",
"@types/youtube": "^0.0.46",
"material-components-web": "14.0.0-canary.c047f7c19.0",
"material-components-web": "14.0.0-canary.9736ddce9.0",
"rxjs": "^6.6.7",
"rxjs-tslint-rules": "^4.34.8",
"tslib": "^2.3.1",
Expand Down Expand Up @@ -92,53 +92,53 @@
"@bazel/terser": "4.4.5",
"@bazel/typescript": "4.4.5",
"@firebase/app-types": "^0.7.0",
"@material/animation": "14.0.0-canary.c047f7c19.0",
"@material/auto-init": "14.0.0-canary.c047f7c19.0",
"@material/banner": "14.0.0-canary.c047f7c19.0",
"@material/base": "14.0.0-canary.c047f7c19.0",
"@material/button": "14.0.0-canary.c047f7c19.0",
"@material/card": "14.0.0-canary.c047f7c19.0",
"@material/checkbox": "14.0.0-canary.c047f7c19.0",
"@material/chips": "14.0.0-canary.c047f7c19.0",
"@material/circular-progress": "14.0.0-canary.c047f7c19.0",
"@material/data-table": "14.0.0-canary.c047f7c19.0",
"@material/density": "14.0.0-canary.c047f7c19.0",
"@material/dialog": "14.0.0-canary.c047f7c19.0",
"@material/dom": "14.0.0-canary.c047f7c19.0",
"@material/drawer": "14.0.0-canary.c047f7c19.0",
"@material/elevation": "14.0.0-canary.c047f7c19.0",
"@material/fab": "14.0.0-canary.c047f7c19.0",
"@material/feature-targeting": "14.0.0-canary.c047f7c19.0",
"@material/floating-label": "14.0.0-canary.c047f7c19.0",
"@material/form-field": "14.0.0-canary.c047f7c19.0",
"@material/icon-button": "14.0.0-canary.c047f7c19.0",
"@material/image-list": "14.0.0-canary.c047f7c19.0",
"@material/layout-grid": "14.0.0-canary.c047f7c19.0",
"@material/line-ripple": "14.0.0-canary.c047f7c19.0",
"@material/linear-progress": "14.0.0-canary.c047f7c19.0",
"@material/list": "14.0.0-canary.c047f7c19.0",
"@material/menu": "14.0.0-canary.c047f7c19.0",
"@material/menu-surface": "14.0.0-canary.c047f7c19.0",
"@material/notched-outline": "14.0.0-canary.c047f7c19.0",
"@material/radio": "14.0.0-canary.c047f7c19.0",
"@material/ripple": "14.0.0-canary.c047f7c19.0",
"@material/rtl": "14.0.0-canary.c047f7c19.0",
"@material/segmented-button": "14.0.0-canary.c047f7c19.0",
"@material/select": "14.0.0-canary.c047f7c19.0",
"@material/shape": "14.0.0-canary.c047f7c19.0",
"@material/slider": "14.0.0-canary.c047f7c19.0",
"@material/snackbar": "14.0.0-canary.c047f7c19.0",
"@material/switch": "14.0.0-canary.c047f7c19.0",
"@material/tab": "14.0.0-canary.c047f7c19.0",
"@material/tab-bar": "14.0.0-canary.c047f7c19.0",
"@material/tab-indicator": "14.0.0-canary.c047f7c19.0",
"@material/tab-scroller": "14.0.0-canary.c047f7c19.0",
"@material/textfield": "14.0.0-canary.c047f7c19.0",
"@material/theme": "14.0.0-canary.c047f7c19.0",
"@material/tooltip": "14.0.0-canary.c047f7c19.0",
"@material/top-app-bar": "14.0.0-canary.c047f7c19.0",
"@material/touch-target": "14.0.0-canary.c047f7c19.0",
"@material/typography": "14.0.0-canary.c047f7c19.0",
"@material/animation": "14.0.0-canary.9736ddce9.0",
"@material/auto-init": "14.0.0-canary.9736ddce9.0",
"@material/banner": "14.0.0-canary.9736ddce9.0",
"@material/base": "14.0.0-canary.9736ddce9.0",
"@material/button": "14.0.0-canary.9736ddce9.0",
"@material/card": "14.0.0-canary.9736ddce9.0",
"@material/checkbox": "14.0.0-canary.9736ddce9.0",
"@material/chips": "14.0.0-canary.9736ddce9.0",
"@material/circular-progress": "14.0.0-canary.9736ddce9.0",
"@material/data-table": "14.0.0-canary.9736ddce9.0",
"@material/density": "14.0.0-canary.9736ddce9.0",
"@material/dialog": "14.0.0-canary.9736ddce9.0",
"@material/dom": "14.0.0-canary.9736ddce9.0",
"@material/drawer": "14.0.0-canary.9736ddce9.0",
"@material/elevation": "14.0.0-canary.9736ddce9.0",
"@material/fab": "14.0.0-canary.9736ddce9.0",
"@material/feature-targeting": "14.0.0-canary.9736ddce9.0",
"@material/floating-label": "14.0.0-canary.9736ddce9.0",
"@material/form-field": "14.0.0-canary.9736ddce9.0",
"@material/icon-button": "14.0.0-canary.9736ddce9.0",
"@material/image-list": "14.0.0-canary.9736ddce9.0",
"@material/layout-grid": "14.0.0-canary.9736ddce9.0",
"@material/line-ripple": "14.0.0-canary.9736ddce9.0",
"@material/linear-progress": "14.0.0-canary.9736ddce9.0",
"@material/list": "14.0.0-canary.9736ddce9.0",
"@material/menu": "14.0.0-canary.9736ddce9.0",
"@material/menu-surface": "14.0.0-canary.9736ddce9.0",
"@material/notched-outline": "14.0.0-canary.9736ddce9.0",
"@material/radio": "14.0.0-canary.9736ddce9.0",
"@material/ripple": "14.0.0-canary.9736ddce9.0",
"@material/rtl": "14.0.0-canary.9736ddce9.0",
"@material/segmented-button": "14.0.0-canary.9736ddce9.0",
"@material/select": "14.0.0-canary.9736ddce9.0",
"@material/shape": "14.0.0-canary.9736ddce9.0",
"@material/slider": "14.0.0-canary.9736ddce9.0",
"@material/snackbar": "14.0.0-canary.9736ddce9.0",
"@material/switch": "14.0.0-canary.9736ddce9.0",
"@material/tab": "14.0.0-canary.9736ddce9.0",
"@material/tab-bar": "14.0.0-canary.9736ddce9.0",
"@material/tab-indicator": "14.0.0-canary.9736ddce9.0",
"@material/tab-scroller": "14.0.0-canary.9736ddce9.0",
"@material/textfield": "14.0.0-canary.9736ddce9.0",
"@material/theme": "14.0.0-canary.9736ddce9.0",
"@material/tooltip": "14.0.0-canary.9736ddce9.0",
"@material/top-app-bar": "14.0.0-canary.9736ddce9.0",
"@material/touch-target": "14.0.0-canary.9736ddce9.0",
"@material/typography": "14.0.0-canary.9736ddce9.0",
"@octokit/rest": "18.3.5",
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/plugin-node-resolve": "^13.1.3",
Expand Down
2 changes: 2 additions & 0 deletions src/material-experimental/mdc-list/interactive-list-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export abstract class MatInteractiveListBase<T extends MatListItemBase>
this._foundation.handleClick(
this._indexForElement(event.target as HTMLElement),
/* isCheckboxAlreadyUpdatedInAdapter */ false,
event,
);
}

Expand Down Expand Up @@ -84,6 +85,7 @@ export abstract class MatInteractiveListBase<T extends MatListItemBase>
protected _initWithAdapter(adapter: MDCListAdapter) {
this._adapter = adapter;
this._foundation = new MDCListFoundation(adapter);
this._foundation.setDisabledItemsFocusable(false);
}

ngAfterViewInit() {
Expand Down
4 changes: 2 additions & 2 deletions src/material-experimental/mdc-list/selection-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,14 @@ describe('MDC-based MatSelectionList without forms', () => {
expect(getFocusIndex()).toEqual(3);
});

it('should be able to focus the first item when pressing HOME', () => {
it('should be able to focus the first non-disabled item when pressing HOME', () => {
listOptions[2].nativeElement.focus();
expect(getFocusIndex()).toBe(2);

const event = dispatchKeyboardEvent(listOptions[2].nativeElement, 'keydown', HOME);
fixture.detectChanges();

expect(getFocusIndex()).toBe(0);
expect(getFocusIndex()).toBe(1);
expect(event.defaultPrevented).toBe(true);
});

Expand Down
Loading

0 comments on commit a392616

Please sign in to comment.