INNER CODE UNIT · JavaScript

handleScroll

kubewall/kubewall · client/src/components/app/Common/ScrollBar/index.js:7

function handleScroll(event) {
  const element = event.target;
  if (!(element instanceof Element)) return;

  element.classList.add(SCROLLBAR_ACTIVE_CLASS);

  clearTimeout(hideTimers.get(element));
  hideTimers.set(
    element,
    setTimeout(() => element.classList.remove(SCROLLBAR_ACTIVE_CLASS), HIDE_DELAY_MS)
  );
}

// `scroll` events don't bubble, but they do propagate through the capture
// phase, so one listener on `document` catches scrolling on every element -
// current or added later - with no MutationObserver and no per-element
// listener registration.
if (typeof window !== 'undefined') {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…