MCPcopy Create free account
hub / github.com/angular/components / _updateValueIndicatorUI

Method _updateValueIndicatorUI

src/material/slider/slider.ts:741–762  ·  view source on GitHub ↗

Updates the value indicator tooltip ui for the given thumb.

(source: _MatSliderThumb)

Source from the content-addressed store, hash-verified

739
740 /** Updates the value indicator tooltip ui for the given thumb. */
741 _updateValueIndicatorUI(source: _MatSliderThumb): void {
742 if (this._skipUpdate()) {
743 return;
744 }
745
746 const valuetext = this.displayWith(source.value);
747
748 this._hasViewInitialized
749 ? source._valuetext.set(valuetext)
750 : source._hostElement.setAttribute('aria-valuetext', valuetext);
751
752 if (this.discrete) {
753 source.thumbPosition === _MatThumb.START
754 ? (this.startValueIndicatorText = valuetext)
755 : (this.endValueIndicatorText = valuetext);
756
757 const visualThumb = this._getThumb(source.thumbPosition);
758 valuetext.length < 3
759 ? visualThumb._hostElement.classList.add('mdc-slider__thumb--short-value')
760 : visualThumb._hostElement.classList.remove('mdc-slider__thumb--short-value');
761 }
762 }
763
764 /** Updates all value indicator UIs in the slider. */
765 private _updateValueIndicatorUIs(): void {

Callers 3

_initUINonRangeMethod · 0.95
_onValueChangeMethod · 0.95

Calls 6

_skipUpdateMethod · 0.95
_getThumbMethod · 0.95
setMethod · 0.80
removeMethod · 0.65
displayWithMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected