Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when the tab panel moves the page down when larger than the viewable area. #239

Closed
lundie opened this issue Apr 3, 2024 · 3 comments

Comments

@lundie
Copy link

lundie commented Apr 3, 2024

If my viewable area is smaller than the selected tab, the page jumps down to the bottom of the page. It then returns when clicking on a shorter tab.

Scrnliscreenshottool.mp4
<div data-controller="tabs" data-tabs-active-tab-class="-mb-px border-l border-t border-r rounded-t">
  <ul class="list-reset flex border-b">
    <li class="-mb-px mr-1" data-tabs-target="tab" data-action="click->tabs#change:prevent">
      <a class="bg-white inline-block py-2 px-4 text-blue-500 hover:text-blue-700 font-semibold no-underline" href="#">Active</a>
    </li>
    <li class="mr-1" data-tabs-target="tab" data-action="click->tabs#change:prevent">
      <a class="bg-white inline-block py-2 px-4 text-blue-500 hover:text-blue-700 font-semibold no-underline" href="#">Tab</a>
    </li>
    <li class="mr-1" data-tabs-target="tab" data-action="click->tabs#change:prevent">
      <a class="bg-white inline-block py-2 px-4 text-blue-500 hover:text-blue-700 font-semibold no-underline" href="#">Tab</a>
    </li>
    <li class="mr-1">
      <a class="bg-white inline-block py-2 px-4 text-gray-300 font-semibold no-underline" href="#">Tab</a>
    </li>
  </ul>

  <div class="hidden py-4 px-4 border-l border-b border-r" data-tabs-target="panel">
    <div class="mb-96">
      Lorem ipsum dolor, sit amet consectetur adipisicing elit. Aperiam eum ex quidem voluptate ea debitis distinctio a dicta consequuntur, deleniti veniam officia sed consectetur obcaecati veritatis iusto aspernatur fugiat. Veritatis?
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit fugit mollitia non numquam consequatur! Eaque aperiam, soluta consectetur, dignissimos necessitatibus alias temporibus minima, perferendis ex aliquam minus ipsam cum voluptatum.
      Lorem ipsum dolor sit, amet consectetur adipisicing elit. Exercitationem architecto dicta quos possimus, temporibus voluptate labore voluptatem quibusdam, facere quisquam maxime reiciendis saepe excepturi? Corrupti sit cumque temporibus repudiandae exercitationem.
    </div>
  </div>

  <div class="hidden py-4 px-4 border-l border-b border-r" data-tabs-target="panel">
    Tab panel 2
  </div>

  <div class="hidden py-4 px-4 border-l border-b border-r" data-tabs-target="panel">
    Tab panel 3
  </div>
</div>
@excid3
Copy link
Owner

excid3 commented Apr 3, 2024

I cannot reproduce this on v5.1.

@lundie
Copy link
Author

lundie commented Apr 3, 2024

Yes, my bad. I was on 4. Thanks :)

@lundie lundie closed this as completed Apr 3, 2024
@excid3
Copy link
Owner

excid3 commented Apr 3, 2024

Ah good! If I remember right, that was caused by the "scroll tab into view" feature that I have since disabled for this reason. You can opt-in to it now, but it was enabled by default in 4.1 or something.

It was meant to just horizontally scroll the tab into view, but it would also scroll the page vertically which wasn't desired. We could restore that functionality if someone knows how to only scroll the tab horizontally without the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants