fixed bug where the page title was shown as tooltip on mouse hover

This commit is contained in:
2026-11-12 23:07:52 +01:00
parent 9535bfedf5
commit e6e8d192cc
3 changed files with 28 additions and 2 deletions
@@ -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<string | null>(null);
readonly eyebrow = input<string | null>(null);
readonly titleTooltip = input<string | null>(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<HTMLElement>>(ElementRef).nativeElement.removeAttribute(
'title',
);
}
}
@@ -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<string | null>(null);
readonly titleTooltip = input<string | null>(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<HTMLElement>>(ElementRef).nativeElement.removeAttribute(
'title',
);
}
}
@@ -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<HTMLElement>>(ElementRef).nativeElement.removeAttribute(
'title',
);
this.form.valueChanges
.pipe(debounceTime(250), takeUntilDestroyed(this.destroyRef))
.subscribe(() => {