Skip to content

Commit c388dc6

Browse files
committed
fixup! refactor(cdk-experimental/ui-patterns): iterate on expansion behavior
1 parent 232f390 commit c388dc6

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/cdk-experimental/ui-patterns/behaviors/expansion/expansion.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ describe('Expansion', () => {
162162

163163
describe('#openAll', () => {
164164
it('should open all focusable and expandable items when multiExpandable is true', () => {
165-
const {expansion, items} = getExpansion({
165+
const {expansion} = getExpansion({
166166
numItems: 3,
167167
multiExpandable: signal(true),
168168
});
@@ -191,7 +191,7 @@ describe('Expansion', () => {
191191
});
192192

193193
it('should do nothing when multiExpandable is false', () => {
194-
const {expansion, items} = getExpansion({
194+
const {expansion} = getExpansion({
195195
numItems: 3,
196196
multiExpandable: signal(false),
197197
});

src/cdk-experimental/ui-patterns/tabs/tabs.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ export class TabListPattern {
171171
.on(this.nextKey, () => this.next({select: this.followFocus()}))
172172
.on('Home', () => this.first({select: this.followFocus()}))
173173
.on('End', () => this.last({select: this.followFocus()}))
174-
.on(' ', () => this.select({select: true}))
175-
.on('Enter', () => this.select({select: true}));
174+
.on(' ', () => this._select({select: true}))
175+
.on('Enter', () => this._select({select: true}));
176176
});
177177

178178
/** The pointerdown event manager for the tablist. */
@@ -217,25 +217,25 @@ export class TabListPattern {
217217
/** Navigates to the first option in the tablist. */
218218
first(opts?: SelectOptions) {
219219
this.navigation.first();
220-
this.select(opts);
220+
this._select(opts);
221221
}
222222

223223
/** Navigates to the last option in the tablist. */
224224
last(opts?: SelectOptions) {
225225
this.navigation.last();
226-
this.select(opts);
226+
this._select(opts);
227227
}
228228

229229
/** Navigates to the next option in the tablist. */
230230
next(opts?: SelectOptions) {
231231
this.navigation.next();
232-
this.select(opts);
232+
this._select(opts);
233233
}
234234

235235
/** Navigates to the previous option in the tablist. */
236236
prev(opts?: SelectOptions) {
237237
this.navigation.prev();
238-
this.select(opts);
238+
this._select(opts);
239239
}
240240

241241
/** Navigates to the given item in the tablist. */
@@ -244,12 +244,12 @@ export class TabListPattern {
244244

245245
if (item) {
246246
this.navigation.goto(item);
247-
this.select(opts);
247+
this._select(opts);
248248
}
249249
}
250250

251251
/** Handles updating selection for the tablist. */
252-
private select(opts?: SelectOptions) {
252+
private _select(opts?: SelectOptions) {
253253
if (opts?.select) {
254254
this.selection.selectOne();
255255
this.expansionBehavior.open();

0 commit comments

Comments
 (0)