From e6e8d192cc5a582cd8eb10c44172ed68829eb1b3 Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 12 Nov 2026 23:07:52 +0100 Subject: [PATCH] fixed bug where the page title was shown as tooltip on mouse hover --- .../ui/page-container/page-container.component.ts | 12 +++++++++++- .../shared/ui/page-header/page-header.component.ts | 11 ++++++++++- .../ui/weights-sliders/weights-sliders.component.ts | 7 +++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/webapp/src/app/shared/ui/page-container/page-container.component.ts b/webapp/src/app/shared/ui/page-container/page-container.component.ts index 4ff83a16..9110d913 100644 --- a/webapp/src/app/shared/ui/page-container/page-container.component.ts +++ b/webapp/src/app/shared/ui/page-container/page-container.component.ts @@ -1,4 +1,4 @@ -import { Component, input } from '@angular/core'; +import { Component, ElementRef, inject, input } from '@angular/core'; import { PageHeaderComponent } from '../page-header/page-header.component'; /** Shared full-width page frame with a consistent page heading. */ @@ -14,4 +14,14 @@ export class PageContainerComponent { readonly subtitle = input(null); readonly eyebrow = input(null); readonly titleTooltip = input(null); + + constructor() { + // `title` is an input, but a static `title="..."` attribute would also be + // written to the host element. Browsers then show it as a native tooltip + // when hovering anywhere inside the page. Remove the attribute; the input + // value itself is unaffected. + inject>(ElementRef).nativeElement.removeAttribute( + 'title', + ); + } } diff --git a/webapp/src/app/shared/ui/page-header/page-header.component.ts b/webapp/src/app/shared/ui/page-header/page-header.component.ts index 5a700292..73e2afe4 100644 --- a/webapp/src/app/shared/ui/page-header/page-header.component.ts +++ b/webapp/src/app/shared/ui/page-header/page-header.component.ts @@ -1,4 +1,4 @@ -import { Component, input } from '@angular/core'; +import { Component, ElementRef, inject, input } from '@angular/core'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; @@ -20,4 +20,13 @@ export class PageHeaderComponent { readonly eyebrow = input(null); readonly titleTooltip = input(null); readonly level = input<1 | 2 | 3>(1); + + constructor() { + // See PageContainerComponent: a static `title="..."` would stay on the + // host element and trigger the browser's native tooltip for the whole + // section. The input still receives the value. + inject>(ElementRef).nativeElement.removeAttribute( + 'title', + ); + } } diff --git a/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.ts b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.ts index daedb304..6ebbe31b 100644 --- a/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.ts +++ b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.ts @@ -1,6 +1,7 @@ import { Component, DestroyRef, + ElementRef, EventEmitter, Input, OnChanges, @@ -159,6 +160,12 @@ export class WeightsSlidersComponent implements OnInit, OnChanges { private isOwnNavigation = false; constructor() { + // `title` is an input. A static `title="..."` would stay on the host and + // show up as a native tooltip over the whole widget. + inject>(ElementRef).nativeElement.removeAttribute( + 'title', + ); + this.form.valueChanges .pipe(debounceTime(250), takeUntilDestroyed(this.destroyRef)) .subscribe(() => {