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

allow tags to be used as buttons #1815

Merged
merged 12 commits into from
Feb 5, 2024
Merged

allow tags to be used as buttons #1815

merged 12 commits into from
Feb 5, 2024

Conversation

mayank99
Copy link
Contributor

@mayank99 mayank99 commented Feb 1, 2024

Changes

Removed unnecessary styles from tag and added the ability for it to be used on <button> elements. Two of the most prominent changes:

  1. removed user-select because it interferes with clickability and provides no benefit
  2. removed focus-within styles, because tag itself can be focusable (when used as button)

In react, the onClick prop will be used to automatically change the rendered element to "button".

Additionally, labelProps and removeButtonProps have been added for further customization of inner parts.

All of this together addresses a user request where they want to use tags as interactive elements.

Testing

Added unit tests + story.

Updated failing visual tests.

Docs

Updated jsdocs. Added changesets.

Not sure if we should document the "clickable" use-case, because tags were not supposed to be interactive in the first place.

@mayank99 mayank99 self-assigned this Feb 1, 2024
@mayank99 mayank99 marked this pull request as ready for review February 5, 2024 20:52
@mayank99 mayank99 requested review from a team as code owners February 5, 2024 20:52
@mayank99 mayank99 requested review from r100-stack and Ben-Pusey-Bentley and removed request for a team February 5, 2024 20:52
Copy link
Member

@r100-stack r100-stack left a comment

Choose a reason for hiding this comment

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

LGTM

@mayank99 mayank99 merged commit 6ae00ea into main Feb 5, 2024
10 of 11 checks passed
@mayank99 mayank99 deleted the mayank/tag branch February 5, 2024 22:28
@imodeljs-admin imodeljs-admin mentioned this pull request Feb 5, 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.

2 participants