Skip to content

Commit 6d0c7e8

Browse files
Elliott Marquezcopybara-github
authored andcommitted
refactor(list)!: refactor list to reuse ListController
fixes #4967 also fixes list-root focus ring and focusout BREAKING CHANGE: the new ListController behavior no longer waits for event.preventDefault asynchronously because it was causing keyboard navigations to scroll the page. PiperOrigin-RevId: 568300155
1 parent c789c99 commit 6d0c7e8

11 files changed

Lines changed: 61 additions & 462 deletions

File tree

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,23 +206,23 @@ export class ListController<Item extends ListItem> {
206206
/**
207207
* Listener to be bound to the `deactivate-items` item event.
208208
*/
209-
onDeactivateItems() {
209+
onDeactivateItems = () => {
210210
const items = this.items;
211211

212212
for (const item of items) {
213213
this.deactivateItem(item);
214214
}
215-
}
215+
};
216216

217217
/**
218218
* Listener to be bound to the `request-activation` item event..
219219
*/
220-
onRequestActivation(event: Event) {
220+
onRequestActivation = (event: Event) => {
221221
this.onDeactivateItems();
222222
const target = event.target as Item;
223223
this.activateItem(target);
224224
target.focus();
225-
}
225+
};
226226

227227
/**
228228
* Listener to be bound to the `slotchange` event for the slot that renders

0 commit comments

Comments
 (0)