@karmo-co/drift-kit-public 25.19.1 → 25.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components.js CHANGED
@@ -384,6 +384,12 @@
384
384
  if (dk.scrollbar)
385
385
  return;
386
386
  var A = 'data-scrollbar-reveal', S = 'data-scrolling';
387
+ var KIT = '.dk-component-sidebar__body, .dk-component-sidebar__panel-body';
388
+ function revealed(t) {
389
+ if (t.hasAttribute(A))
390
+ return t.getAttribute(A) !== 'always';
391
+ return t.matches(KIT) && !t.closest('[' + A + '="always"]');
392
+ }
387
393
  var ends = 'onscrollend' in window;
388
394
  function quiet(el) {
389
395
  return dk.motion && dk.motion.timing ? dk.motion.timing('state', { el: el }).duration : 0;
@@ -420,7 +426,7 @@
420
426
  var t = e.target;
421
427
  if (t === document)
422
428
  t = document.scrollingElement || document.documentElement;
423
- return t && t.nodeType === 1 && t.hasAttribute(A) ? t : null;
429
+ return t && t.nodeType === 1 && revealed(t) ? t : null;
424
430
  }
425
431
  document.addEventListener('scroll', function (e) { var el = scroller(e); if (el)
426
432
  mark(el); }, { capture: true, passive: true });
@@ -429,7 +435,7 @@
429
435
  stop(el); }, { capture: true, passive: true });
430
436
  dk.scrollbar = {
431
437
  flash: function (el) {
432
- if (!el || !el.hasAttribute(A))
438
+ if (!el || !revealed(el))
433
439
  return;
434
440
  start(el);
435
441
  el.__dkScrollbarQuiet = setTimeout(function () { stop(el); }, quiet(el));