fix(BFormGroup): Apply user classes and label alignment to correct elements in horizontal mode #2943
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.
Describe the PR
In horizontal layout mode, BFormGroup was applying user-provided classes (like
align-items-center) to the outer container and label alignment classes (liketext-md-end) to the label element instead of its BCol wrapper, causing both features to fail.Changes Made
Attribute Routing:
inheritAttrs: falseand manual attribute placement viauseAttrs()rootAttrs,rowAttrs) encapsulate placement logicLabel Alignment:
labelAlignClassesnow apply to BCol wrapper in horizontal modeResult:
Small replication
Labels are now right-aligned (
text-md-end) and vertically centered (align-items-center) as expected.PR checklist
What kind of change does this PR introduce? (check at least one)
fix(...)feat(...)fix(...)docs(...)The PR fulfills these requirements:
CHANGELOGis generated from these messages, and determines the next version type. Pull requests that do not follow conventional commits or do not have an override will be deniedOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.