MOBILE-3320 a11y: Fix course section buttons

main
Noel De Martin 2021-06-03 16:54:33 +02:00
parent e9c84c71d0
commit dd111fce31
1 changed files with 21 additions and 0 deletions

View File

@ -414,6 +414,8 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
CoreCourse.logView(this.course!.id, newSection.section, undefined, this.course!.fullname), CoreCourse.logView(this.course!.id, newSection.section, undefined, this.course!.fullname),
); );
} }
this.invalidateSectionButtons();
} }
/** /**
@ -506,6 +508,25 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
done?.(); done?.();
} }
/**
* Invalidate section buttons so that they are rendered again. This is necessary in order to update
* some attributes that are not reactive, for example aria-label.
*
* @see https://github.com/ionic-team/ionic-framework/issues/21534
*/
protected async invalidateSectionButtons(): Promise<void> {
const previousSection = this.previousSection;
const nextSection = this.nextSection;
this.previousSection = undefined;
this.nextSection = undefined;
await CoreUtils.nextTick();
this.previousSection = previousSection;
this.nextSection = nextSection;
}
/** /**
* Show more activities (only used when showing all the sections at the same time). * Show more activities (only used when showing all the sections at the same time).
* *