starlight icon indicating copy to clipboard operation
starlight copied to clipboard

Fix `<Tabs>` sync issue with inconsistent use of `icon` on `<TabItem>` components

Open HiDeoo opened this issue 1 year ago • 2 comments

Description

This PR fixes an issue with synced tabs when <Tabs> sharing the same syncKey have <TabItem> components that inconsistently use icon or not.

The issue is due to the fact that labels (which need to be identical for tabs to sync) were coming from the textContent property on the tab link which gets the content of all elements. In the presence of an icon, the textContent property could potentially include extra spaces due to the presence of the SVG icon. This pull request fixes the issue by using the innerText property instead of textContent to get the label text as it only returns the rendered text content, which is the exact label text we want to compare.

HiDeoo avatar May 01 '24 11:05 HiDeoo

🦋 Changeset detected

Latest commit: fa9146f409760b2f7d162765baf08af6eaef61e1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar May 01 '24 11:05 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview May 6, 2024 6:38pm

vercel[bot] avatar May 01 '24 11:05 vercel[bot]