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

fix(lemon-ui): Properly indicate clickable and disabled LemonTag #23853

Merged
merged 4 commits into from
Jul 25, 2024

Conversation

Twixes
Copy link
Member

@Twixes Twixes commented Jul 19, 2024

Problem

It was weird that clickable but disabled tags behaved like text:

Screenshot 2024-07-19 at 14 48 22

For some reason, all tags in that TaxonomicFilter UI were also marked aria-disabled, always.

Changes

Clickable tags now behave more like buttons (which they effectively are) and are accessible.

Screenshot 2024-07-19 at 13 22 41

@Twixes Twixes requested a review from a team July 19, 2024 12:52
@@ -38,8 +38,8 @@ function CategoryPill({
type={isActive ? 'primary' : canInteract ? 'option' : 'muted'}
data-attr={`taxonomic-tab-${groupType}`}
onClick={canInteract ? onClick : undefined}
weight="normal"
aria-disabled
Copy link
Member Author

@Twixes Twixes Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EDsCODE Looks like this aria-disabled was added in #22385. What was the reason?

Copy link
Contributor

@daibhin daibhin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are some failing tests

@@ -492,7 +492,7 @@ export function StatusTag({ survey }: { survey: Survey }): JSX.Element {
} as Record<ProgressStatus, LemonTagType>
const status = getSurveyStatus(survey)
return (
<LemonTag type={statusColors[status]} style={{ fontWeight: 600 }} data-attr="status">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder how this crept in past the eslint rule? It was only added 3 months ago

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the rule only applies to props on HTML elements, and not React components 🤔

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@Twixes Twixes force-pushed the accessible-clickable-tag branch from a759903 to 447478f Compare July 25, 2024 10:43
@Twixes Twixes enabled auto-merge (squash) July 25, 2024 10:45
Copy link
Contributor

Size Change: +107 B (+0.01%)

Total Size: 1.07 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.07 MB +107 B (+0.01%)

compressed-size-action

@Twixes Twixes merged commit 9a5ab8f into master Jul 25, 2024
92 checks passed
@Twixes Twixes deleted the accessible-clickable-tag branch July 25, 2024 15:01
silentninja pushed a commit to silentninja/posthog that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants