diff --git a/src/aria/listbox/listbox.ts b/src/aria/listbox/listbox.ts index f1eef7ff83ea..87e08c9a62ed 100644 --- a/src/aria/listbox/listbox.ts +++ b/src/aria/listbox/listbox.ts @@ -159,14 +159,14 @@ export class Listbox { this._popup._controls.set(this._pattern as ComboboxListboxPattern); } - afterRenderEffect(() => { - if (typeof ngDevMode === 'undefined' || ngDevMode) { + if (typeof ngDevMode === 'undefined' || ngDevMode) { + afterRenderEffect(() => { const violations = this._pattern.validate(); for (const violation of violations) { console.error(violation); } - } - }); + }); + } afterRenderEffect(() => { if (!this._hasFocused()) { diff --git a/src/aria/toolbar/toolbar.ts b/src/aria/toolbar/toolbar.ts index afbe8bc51c44..6f29a9962af0 100644 --- a/src/aria/toolbar/toolbar.ts +++ b/src/aria/toolbar/toolbar.ts @@ -109,14 +109,14 @@ export class Toolbar { private _hasBeenFocused = signal(false); constructor() { - afterRenderEffect(() => { - if (typeof ngDevMode === 'undefined' || ngDevMode) { + if (typeof ngDevMode === 'undefined' || ngDevMode) { + afterRenderEffect(() => { const violations = this._pattern.validate(); for (const violation of violations) { console.error(violation); } - } - }); + }); + } afterRenderEffect(() => { if (!this._hasBeenFocused()) {