material-components / material-components/material-components-android

[Tab] Badges on edge tabs get clipped after removing a badge from another tab

Open
#5,068 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Widget: Tab
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:** In TabLayout with `app:tabGravity="center"`, removing a badge from any tab causes badges on the first and last tabs to be partially clipped when they extend beyond the tab bounds.

Steps to reproduce

https://github.com/user-attachments/assets/80ef0ac6-14c5-4b9b-93af-ba2a9222f6d4


Result


**Material Library version:** 1.14.0-beta01

**Device:** Pixel 8 API 36

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TabLayout implementation and reproduce the issue using app:tabGravity="center" on Material Library 1.14.0-beta01, then remove a badge from a tab while observing the first and last tabs. Trace the badge and tab layout handling; done means edge-tab badges remain fully visible after another tab's badge is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.