-
-
Notifications
You must be signed in to change notification settings - Fork 264
Apply BitChoiceGroup improvements (#12740) #12743
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
Open
msynk
wants to merge
21
commits into
bitfoundation:develop
Choose a base branch
from
msynk:12740-blazorui-choicegroup-improvements
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
951e505
apply BitChoiceGroup improvements #12740
msynk 904f917
resolve review comments
msynk 4dba0c3
resolve local review findings
msynk fa690a8
fix local review findings
msynk cfd9d9d
resolve review comments 2
msynk 6ab55aa
resolve review comments 2
msynk 8301b60
resolve review comments 3
msynk eddc6e1
Merge branch 'develop' of https://github.com/bitfoundation/bitplatfor…
msynk f5a659f
resolve review comments 4
msynk 9c06035
resolve review comments 5
msynk 82c8d5a
Merge branch 'develop' into 12740-blazorui-choicegroup-improvements
msynk 91812ac
resolve review comments 6
msynk c209bb5
fix tests
msynk 6f2c88a
resolve review comments 7
msynk df9854b
fix tests
msynk 1383dc6
resolve review comments 8
msynk fe79f40
resolve review comments 9
msynk 89e723b
resolve review comments 9
msynk 4788e0f
resolve review comments 10
msynk 83d68ca
resolve review comments 11
msynk 74545ec
resolve review comments 12
msynk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: bitfoundation/bitplatform
Length of output: 48675
🌐 Web query:
Blazor rendering duplicate attribute names rightmost attribute wins@attributesexplicit attribute duplicate name behavior💡 Result:
In Blazor, when multiple attributes with the same name are present on a markup element—including those provided via explicit declaration and those "splatted" using the
@attributesdirective—the precedence is determined by the order in which they are processed [1][2]. The framework processes attributes from right to left (last to first) [1][3][4]. Because the framework evaluates these attributes in this order, the first attribute encountered (which is the rightmost attribute in your code) wins [1][5]. This behavior is effectively equivalent to "last one wins" when reading the code from left to right [2][5]. Key behaviors to remember: * If you place an attribute to the right of@attributes, that attribute will take precedence because it is processed first [1][6]. * If you place an attribute to the left of@attributes, the attribute contained within the@attributescollection will take precedence because it is processed after the explicit attribute [1][2]. Example: If you have <input@attributes="MyAttributes" class="my-class" />, the class attribute "my-class" is to the right of@attributes. It will be processed first, making "my-class" the final value, even if the "class" key exists within the MyAttributes dictionary [1][2]. Conversely, if you write <input class="my-class"@attributes="MyAttributes" />, the "class" value inside the dictionary will win [2]. This design allows component authors to provide default attributes while still giving consumers the flexibility to override them by correctly positioning their own attributes relative to the@attributesdirective [1][2].Citations:
Do not override consumer-supplied
aria-describedbyafter applying HTML attributes.Blazor right-to-left attribute precedence means the explicit
aria-describedbyhere wins over any consumer-supplied value inHtmlAttributes, including when it evaluates tonulland removes the attribute. Build the final group/itemaria-describedbyin code behind, only providing a generated ID when no caller-supplied value exists.📍 Affects 2 files
src/BlazorUI/Bit.BlazorUI/Components/Inputs/ChoiceGroup/BitChoiceGroup.razor#L6-L21(this comment)src/BlazorUI/Bit.BlazorUI/Components/Inputs/ChoiceGroup/_BitChoiceGroupItem.razor#L23-L47🤖 Prompt for AI Agents