Skip to content

Commit ed4bac5

Browse files
committed
refactor(cdk-experimental/accordion): fix lint errors
Updates previous changes to fix lint errors.
1 parent 177869d commit ed4bac5

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

src/cdk-experimental/accordion/accordion.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class CdkAccordionPanel {
7272
});
7373

7474
constructor() {
75-
// Connect the panel's hidden state to the DeferredContentAware's visibility.
75+
/** Connect the panel's hidden state to the DeferredContentAware's visibility. */
7676
afterRenderEffect(() => {
7777
this._deferredContentAware.contentVisible.set(!this.pattern.hidden());
7878
});
@@ -144,8 +144,9 @@ export class CdkAccordionTrigger {
144144
accordionPanel: this.accordionPanel,
145145
});
146146

147-
/** The computed label value of this Accordion Trigger to be passed to a visually hidden
148-
* span that is accessible to screen readers whether the button is disabled or not.
147+
/**
148+
* The computed label value of this Accordion Trigger to be passed to a visually hidden
149+
* span that is accessible to screen readers whether the button is disabled or not.
149150
*/
150151
readonly visuallyHiddenLabel = computed(() => {
151152
let buttonText = '';
@@ -156,11 +157,11 @@ export class CdkAccordionTrigger {
156157
}
157158
}
158159

159-
// Determine the state labels of the Accordion Trigger to pass to the label
160+
/** Determine the state labels of the Accordion Trigger to pass to the label. */
160161
const expansionLabel = this.pattern.expanded() ? '(Expanded)' : '(Collapsed)';
161162
const disabledLabel = this.pattern.disabled() ? '(Disabled)' : '';
162163

163-
// Combine all parts into the final label
164+
/** Combine all parts into the final label. */
164165
return `${buttonText.trim()} ${expansionLabel} ${disabledLabel}`.trim();
165166
});
166167

@@ -170,7 +171,7 @@ export class CdkAccordionTrigger {
170171
const parentElement = this._renderer.parentNode(buttonElement);
171172

172173
if (parentElement) {
173-
// Create the span and attach it to the DOM only once.
174+
/** Create the span and attach it to the DOM only once. */
174175
if (!this._visuallyHiddenSpan) {
175176
this._visuallyHiddenSpan = this._renderer.createElement('span');
176177
this._renderer.addClass(this._visuallyHiddenSpan, 'cdk-visually-hidden');
@@ -183,7 +184,7 @@ export class CdkAccordionTrigger {
183184
this._renderer.insertBefore(parentElement, this._visuallyHiddenSpan, buttonElement);
184185
}
185186

186-
// Update its text content whenever the signal changes.
187+
/** Update its text content whenever the signal changes. */
187188
this._renderer.setProperty(
188189
this._visuallyHiddenSpan,
189190
'textContent',
@@ -193,7 +194,7 @@ export class CdkAccordionTrigger {
193194
});
194195
}
195196

196-
// Add a private property to store a reference to the span
197+
/** Add a private property to store a reference to the span. */
197198
private _visuallyHiddenSpan!: HTMLElement;
198199
}
199200

@@ -239,18 +240,20 @@ export class CdkAccordionGroup {
239240
/** The UI pattern instance for this accordion group. */
240241
readonly pattern: AccordionGroupPattern = new AccordionGroupPattern({
241242
...this,
242-
// TODO(ok7sai): Consider making `activeItem` an internal state in the pattern and call
243-
// `setDefaultState` in the CDK.
243+
/**
244+
* TODO(ok7sai): Consider making `activeItem` an internal state in the pattern and call
245+
* `setDefaultState` in the CDK.
246+
*/
244247
activeItem: signal(undefined),
245248
items: computed(() => this._triggers().map(trigger => trigger.pattern)),
246249
expandedIds: this.value,
247-
// TODO(ok7sai): Investigate whether an accordion should support horizontal mode.
250+
/** TODO(ok7sai): Investigate whether an accordion should support horizontal mode. */
248251
orientation: () => 'vertical',
249252
element: () => this._elementRef.nativeElement,
250253
});
251254

252255
constructor() {
253-
// Effect to link triggers with their corresponding panels and update the group's items.
256+
/** Effect to link triggers with their corresponding panels and update the group's items. */
254257
afterRenderEffect(() => {
255258
const triggers = this._triggers();
256259
const panels = this._panels();

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ export type AccordionTriggerInputs = Omit<ListNavigationItem & ListFocusItem, 'i
8181
/** The accordion panel controlled by this trigger. */
8282
accordionPanel: SignalLike<AccordionPanelPattern | undefined>;
8383

84-
/** The id of the visually hidden span associated with the Accordion Trigger to be referenced by
85-
* screen readers at all times for consistent accessibility.
84+
/**
85+
* The id of the visually hidden span associated with the Accordion Trigger to be
86+
* referenced by screen readers at all times for consistent accessibility.
8687
*/
8788
visuallyHiddenId: SignalLike<string>;
8889
};

0 commit comments

Comments
 (0)