Skip to content

fix(form): correct .control selector edge case for last-child grouping (#4045)#4046

Open
Jlawl1et wants to merge 3 commits into
jgthms:mainfrom
Jlawl1et:fix-4045-control-last-child-selector
Open

fix(form): correct .control selector edge case for last-child grouping (#4045)#4046
Jlawl1et wants to merge 3 commits into
jgthms:mainfrom
Jlawl1et:fix-4045-control-last-child-selector

Conversation

@Jlawl1et

Copy link
Copy Markdown

This is a bugfix.

Proposed solution

Fix incorrect addon behavior in .control grouping when non-.control siblings (e.g. label) are present. Structural pseudo-classes (:last-child, :only-child, etc.) are replaced with their :of-type equivalents to avoid interference from non-control elements.

Tradeoffs

:of-type is based on element type, not class. Edge cases may still occur if other sibling elements share the same tag name.

Testing Done

Manual test with a label followed by a single .control. Verified correct addon behavior.

Changelog updated?

No.

Issue

Fixes #4045

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.

Unintended behavior with .control:last-child:not(:only-child) when other sibling tags are present

1 participant