How can I address the issue where the Tailwind CSS tooltip disappears within an overflow-auto parent div?

The tooltips for each menu item are becoming hidden due to the overflow-auto property set on the menu container, which has a max-height.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><div class="max-w-sm border rounded-lg m-6">
<div class="space-y-2 max-h-[200px] 2xl:max-h-[400px] overflow-y-auto p-6">
<a class="relative w-full flex items-center pl-[28px] pr-[14px] py-2 cursor-pointer rounded-[3px] border-l-[4px] transition-all duration-500 hover:bg-purple-300 group">
<span>Menu 1</span>
<div class="absolute py-2 px-4 w-max min-w-12 max-w-[260px] rounded-md bg-indigo-800 pointer-events-none z-30 opacity-0 group-hover:opacity-100 transition-all duration-300 bottom-full inset-x-0 mx-auto mb-2">
<div class="flex flex-col space-y-2">
<span class="text-white text-sm leading-[18px] break-all whitespace-normal">Tooltip 1</span>
</div>
<svg class="absolute text-indigo-800 h-1 w-full left-0 top-full" xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4" fill="none">
<path d="M4 4L8 2.28531e-06L1.14444e-06 1.43051e-06L4 4Z" fill="#19005F"/>
</svg>
</div>
</a>
<a class="relative w-full flex items-center pl-[28px] pr-[14px] py-2 cursor-pointer rounded-[3px] border-l-[4px] transition-all duration-500 hover:bg-purple-300 group">
<span>Menu 2</span>
<div class="absolute py-2 px-4 w-max min-w-12 max-w-[260px] rounded-md bg-indigo-800 pointer-events-none z-30 opacity-0 group-hover:opacity-100 transition-all duration-300 bottom-full inset-x-0 mx-auto mb-2">
<div class="flex flex-col space-y-2">
<span class="text-white text-sm leading-[18px] break-all whitespace-normal">Tooltip 2</span>
</div>
<svg class="absolute text-indigo-800 h-1 w-full left-0 top-full" xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4" fill="none">
<path d="M4 4L8 2.28531e-06L1.14444e-06 1.43051e-06L4 4Z" fill="#19005F"/>
</svg>
</div>
</a>
</div>
</div>
</code>
<code><div class="max-w-sm border rounded-lg m-6"> <div class="space-y-2 max-h-[200px] 2xl:max-h-[400px] overflow-y-auto p-6"> <a class="relative w-full flex items-center pl-[28px] pr-[14px] py-2 cursor-pointer rounded-[3px] border-l-[4px] transition-all duration-500 hover:bg-purple-300 group"> <span>Menu 1</span> <div class="absolute py-2 px-4 w-max min-w-12 max-w-[260px] rounded-md bg-indigo-800 pointer-events-none z-30 opacity-0 group-hover:opacity-100 transition-all duration-300 bottom-full inset-x-0 mx-auto mb-2"> <div class="flex flex-col space-y-2"> <span class="text-white text-sm leading-[18px] break-all whitespace-normal">Tooltip 1</span> </div> <svg class="absolute text-indigo-800 h-1 w-full left-0 top-full" xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4" fill="none"> <path d="M4 4L8 2.28531e-06L1.14444e-06 1.43051e-06L4 4Z" fill="#19005F"/> </svg> </div> </a> <a class="relative w-full flex items-center pl-[28px] pr-[14px] py-2 cursor-pointer rounded-[3px] border-l-[4px] transition-all duration-500 hover:bg-purple-300 group"> <span>Menu 2</span> <div class="absolute py-2 px-4 w-max min-w-12 max-w-[260px] rounded-md bg-indigo-800 pointer-events-none z-30 opacity-0 group-hover:opacity-100 transition-all duration-300 bottom-full inset-x-0 mx-auto mb-2"> <div class="flex flex-col space-y-2"> <span class="text-white text-sm leading-[18px] break-all whitespace-normal">Tooltip 2</span> </div> <svg class="absolute text-indigo-800 h-1 w-full left-0 top-full" xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4" fill="none"> <path d="M4 4L8 2.28531e-06L1.14444e-06 1.43051e-06L4 4Z" fill="#19005F"/> </svg> </div> </a> </div> </div> </code>
<div class="max-w-sm border rounded-lg m-6">
  <div class="space-y-2 max-h-[200px] 2xl:max-h-[400px] overflow-y-auto p-6">
    <a class="relative w-full flex items-center pl-[28px] pr-[14px] py-2 cursor-pointer rounded-[3px] border-l-[4px] transition-all duration-500 hover:bg-purple-300 group">
      <span>Menu 1</span>
      <div class="absolute py-2 px-4 w-max min-w-12 max-w-[260px] rounded-md bg-indigo-800 pointer-events-none z-30 opacity-0 group-hover:opacity-100 transition-all duration-300 bottom-full inset-x-0 mx-auto mb-2">
        <div class="flex flex-col space-y-2">
          <span class="text-white text-sm leading-[18px] break-all whitespace-normal">Tooltip 1</span>
        </div>
        <svg class="absolute text-indigo-800 h-1 w-full left-0 top-full" xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4" fill="none">
          <path d="M4 4L8 2.28531e-06L1.14444e-06 1.43051e-06L4 4Z" fill="#19005F"/>
        </svg>
      </div>
    </a>
    <a class="relative w-full flex items-center pl-[28px] pr-[14px] py-2 cursor-pointer rounded-[3px] border-l-[4px] transition-all duration-500 hover:bg-purple-300 group">
      <span>Menu 2</span>
      <div class="absolute py-2 px-4 w-max min-w-12 max-w-[260px] rounded-md bg-indigo-800 pointer-events-none z-30 opacity-0 group-hover:opacity-100 transition-all duration-300 bottom-full inset-x-0 mx-auto mb-2">
        <div class="flex flex-col space-y-2">
          <span class="text-white text-sm leading-[18px] break-all whitespace-normal">Tooltip 2</span>
        </div>
        <svg class="absolute text-indigo-800 h-1 w-full left-0 top-full" xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4" fill="none">
          <path d="M4 4L8 2.28531e-06L1.14444e-06 1.43051e-06L4 4Z" fill="#19005F"/>
        </svg>
      </div>
    </a>
  </div>
</div>

Source code: https://play.tailwindcss.com/eXDr2VAvWC

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật