Toggle tooltip only when it is enabled in Slider
* Update when tooltip is enabled in Slider
We don't want the `toggleTooltip` happening when tooltip is set to `false`.
This solves errors with accessing style attribute of a `null`.
* remove semicolon failing linter test
* trailing whitespace
@@ -185,6 +185,8 @@ abstract class AbstractBaseSliderView extends ControlView {
this._set_keypress_handles()
const toggleTooltip = (i: number, show: boolean): void => {
+ if (!tooltips)
+ return
const handle = this.slider_el.querySelectorAll(`.${prefix}handle`)[i]
const tooltip = handle.querySelector<HTMLElement>(`.${prefix}tooltip`)!
tooltip.style.display = show ? 'block' : ''
