Barty
Barty

Reputation: 567

Tailwind fixed tabs nav makes it unscrollable

I have some tabs in one of my pages.

I made it fixed so that when I scroll on the items of each tab page the user can go down through them without moving the nav tabs.

Before I made it fixed I could scroll sideways through the tabs (there was a lot). But now since I made it fixed I cannot scroll them.

Here is where I made it fixed:

<div className="pb-3 fixed  z-10 bg-white">

      <nav
          className="-mb-px flex space-x-8 overflow-x-auto"
          aria-label="Tabs"
        >

Upvotes: 0

Views: 632

Answers (1)

saboshi69
saboshi69

Reputation: 895

You should define the width of the nav bar so that there is a boundary for the tabs to be overflow.

Example

className="top-0 fixed left-0 w-full"

Upvotes: 1

Related Questions