From 3ee596a10de25a5f1480b30f255f9d2e8e4ae3f6 Mon Sep 17 00:00:00 2001 From: Meghea Iulian Date: Tue, 9 Apr 2024 15:38:55 +0300 Subject: [PATCH] feat(cosmoz-tab): update compute-scroll-into-view --- src/next/cosmoz-tab.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/next/cosmoz-tab.js b/src/next/cosmoz-tab.js index 7312e45..fdbe1ab 100644 --- a/src/next/cosmoz-tab.js +++ b/src/next/cosmoz-tab.js @@ -1,7 +1,7 @@ import { component, useEffect, useLayoutEffect } from '@pionjs/pion'; import { html, nothing } from 'lit-html'; import { ifDefined } from 'lit-html/directives/if-defined.js'; -import computeScroll from 'compute-scroll-into-view'; +import { compute } from 'compute-scroll-into-view'; import style from './cosmoz-tab.css'; @@ -22,12 +22,12 @@ const Tab = (host) => { if (!active) { return; } - computeScroll(el, { + compute(el, { block: 'nearest', inline: 'center', boundary: el.parentElement, }).forEach(({ el, top, left }) => - el.scroll({ top, left, behavior: 'smooth' }) + el.scroll({ top, left, behavior: 'smooth' }), ); }, [active]); @@ -49,5 +49,5 @@ customElements.define( 'cosmoz-tab-next', component(Tab, { observedAttributes: ['active', 'badge', 'href'], - }) + }), );