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

Tabs with badge content wrap to newline before 'More views' disclosure #11544

Closed
mlandry opened this issue Feb 1, 2024 · 1 comment · May be fixed by #13253
Closed

Tabs with badge content wrap to newline before 'More views' disclosure #11544

mlandry opened this issue Feb 1, 2024 · 1 comment · May be fixed by #13253

Comments

@mlandry
Copy link

mlandry commented Feb 1, 2024

Issue summary

When using the Tabs component with a) more tabs than fit in the width of the layout and b) badged content, tabs wrap to a second spaced-out line before the More views disclosure.

Expected behavior

Tabs should fit on a single line with More views hiding the rest

Actual behavior

This issue does not reproduce using LegacyTabs (with badges included in the content ReactNode itself):
Screenshot 2024-02-01 at 10 52 12 AM

nor with new Tabs without any badges:
Screenshot 2024-02-01 at 10 54 50 AM

but with TabProps.badge added, the wrapping behaviour is seen consistently on a variety of screen sizes
Screenshot 2024-02-01 at 10 55 31 AM

Steps to reproduce the problem

Use Tabs within a Card or LegacyCard with 10+ tabs with badge set and a variety of long content titles.

Reduced test case

Reproduced in code sandbox here: https://codesandbox.io/p/sandbox/flamboyant-paper-9ltffg
Screenshot 2024-02-01 at 11 14 13 AM

Specifications

  • Are you using the React components? (Y/N): Y
  • Polaris version number: 12.10.0
  • Browser: Google Chrome 119.0.6045.105
  • Device: MacBook Pro
  • Operating System: macOS Sonoma 14.1.1

Or run npx envinfo --system --binaries --browsers --npmPackages react,react-dom,@shopify/polaris to provide specifications on your environment including version numbers, browser, device, and operating system.

Paste the results here:

  System:
    OS: macOS 14.1.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 102.92 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.4.0 - ~/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.7.2 - /opt/homebrew/bin/npm
    Watchman: 2023.07.10.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 119.0.6045.123
    Safari: 17.1
  npmPackages:
    @shopify/polaris: 12.10.0 => 12.10.0
    react: 18.2.0 => 18.2.0
    react-dom: 18.2.0 => 18.2.0
Copy link
Contributor

Hi! We noticed there hasn’t been activity on this issue in a while. After 30 days, it will close automatically.

If it’s still relevant, or you have updates, comment and let us know. And don’t worry, you can always re-open later if needed.

ascherkus added a commit to roundtrip/polaris that referenced this issue Feb 19, 2025
ascherkus added a commit to roundtrip/polaris that referenced this issue Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant