fix(ui): keep button text visible during loading states and improve accessibility#71
Open
TeeYml wants to merge 1 commit into
Open
fix(ui): keep button text visible during loading states and improve accessibility#71TeeYml wants to merge 1 commit into
TeeYml wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
Problem
The shared
Buttoncomponent was hiding itschildrenwhileisLoadingwas true, only showing a spinner. This caused important context to be lost in several flows (e.g., whether a project was being submitted, updated, or loaded).Solution
This PR updates the
Buttoncomponent to retain its meaningful text during loading states by default, while still ensuring forms prevent duplicate submits.Key Changes:
children) is no longer hidden whenisLoadingis true. The spinner now gracefully replaces only theleftIcon.aria-busy={isLoading}to communicate the loading state to screen readers.aria-hidden="true"to theLoader2spinner to prevent repetitive or confusing screen reader announcements.loadingTextprop. If a button lacks explicit text or anaria-label, a screen-reader-only (sr-only) fallback text is automatically rendered to ensure strict accessibility compliance.disabled={isLoading || disabled}behavior was explicitly retained.Closes #65