diff --git a/src/core/features/block/components/side-blocks-button/side-blocks-button.html b/src/core/features/block/components/side-blocks-button/side-blocks-button.html index 69fdcdf8f..d7450264c 100644 --- a/src/core/features/block/components/side-blocks-button/side-blocks-button.html +++ b/src/core/features/block/components/side-blocks-button/side-blocks-button.html @@ -1,4 +1,3 @@ - + diff --git a/src/core/features/block/components/side-blocks-button/side-blocks-button.ts b/src/core/features/block/components/side-blocks-button/side-blocks-button.ts index 03efee0ae..bc62226d7 100644 --- a/src/core/features/block/components/side-blocks-button/side-blocks-button.ts +++ b/src/core/features/block/components/side-blocks-button/side-blocks-button.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, ElementRef, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { Component, ElementRef, Input, OnDestroy, OnInit } from '@angular/core'; import { CoreCancellablePromise } from '@classes/cancellable-promise'; import { CoreUserTourDirectiveOptions } from '@directives/user-tour'; import { CoreUserToursAlignment, CoreUserToursSide } from '@features/usertours/services/user-tours'; @@ -33,14 +33,17 @@ export class CoreBlockSideBlocksButtonComponent implements OnInit, OnDestroy { @Input() contextLevel!: string; @Input() instanceId!: number; - @ViewChild('button', { read: ElementRef }) button?: ElementRef; userTour: CoreUserTourDirectiveOptions = { id: 'side-blocks-button', component: CoreBlockSideBlocksTourComponent, side: CoreUserToursSide.Start, alignment: CoreUserToursAlignment.Center, - getFocusedElement: nativeButton => nativeButton.shadowRoot?.children[0] as HTMLElement, + getFocusedElement: nativeButton => { + const innerButton = Array.from(nativeButton.shadowRoot?.children ?? []).find(child => child.tagName === 'BUTTON'); + + return innerButton as HTMLElement ?? nativeButton; + }, }; protected element: HTMLElement; diff --git a/src/core/features/course/components/course-format/course-format.html b/src/core/features/course/components/course-format/course-format.html index 4b86d5ce7..7db7e5d2d 100644 --- a/src/core/features/course/components/course-format/course-format.html +++ b/src/core/features/course/components/course-format/course-format.html @@ -56,7 +56,7 @@ + color="secondary"> {{'core.course.courseindex' | translate }} diff --git a/src/core/features/course/components/course-format/course-format.ts b/src/core/features/course/components/course-format/course-format.ts index b6bada1f1..38047778b 100644 --- a/src/core/features/course/components/course-format/course-format.ts +++ b/src/core/features/course/components/course-format/course-format.ts @@ -23,7 +23,6 @@ import { QueryList, Type, ElementRef, - ViewChild, } from '@angular/core'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreDynamicComponent } from '@components/dynamic-component/dynamic-component'; @@ -77,7 +76,6 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { @Input() moduleId?: number; // The module ID to scroll to. Must be inside the initial selected section. @ViewChildren(CoreDynamicComponent) dynamicComponents?: QueryList; - @ViewChild('courseIndexFab', { read: ElementRef }) courseIndexFab?: ElementRef; // All the possible component classes. courseFormatComponent?: Type; @@ -93,7 +91,11 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { component: CoreCourseCourseIndexTourComponent, side: CoreUserToursSide.Top, alignment: CoreUserToursAlignment.End, - getFocusedElement: nativeButton => nativeButton.shadowRoot?.children[0] as HTMLElement, + getFocusedElement: nativeButton => { + const innerButton = Array.from(nativeButton.shadowRoot?.children ?? []).find(child => child.tagName === 'BUTTON'); + + return innerButton as HTMLElement ?? nativeButton; + }, }; displayCourseIndex = false; diff --git a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.html b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.html index e24ded5c4..b4eb942c5 100644 --- a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.html +++ b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.html @@ -1,4 +1,4 @@ + [attr.aria-label]="'core.user.useraccount' | translate"> diff --git a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts index 54e11f46f..bece772fe 100644 --- a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts +++ b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { CoreSiteInfo } from '@classes/site'; import { CoreUserTourDirectiveOptions } from '@directives/user-tour'; import { CoreUserToursAlignment, CoreUserToursSide } from '@features/usertours/services/user-tours'; @@ -44,8 +44,6 @@ export class CoreMainMenuUserButtonComponent implements OnInit { side: CoreScreen.isMobile ? CoreUserToursSide.Start : CoreUserToursSide.End, }; - @ViewChild('avatar', { read: ElementRef }) avatar?: ElementRef; - constructor(protected routerOutlet: IonRouterOutlet) { const currentSite = CoreSites.getRequiredCurrentSite();