feat(TextInputGroup): added validation#6802
Conversation
|
Preview: https://patternfly-pr-6802.surge.sh A11y report: https://patternfly-pr-6802-a11y.surge.sh |
|
@mcoker do you think this would suffice for the above? (or the inverse, update align-items to flex-start then in a badge selector make align-self center) We can't apply the flex-start to the utilities wrapper since that may contain badges/other things which should remain centered. Unless we want to add some modifier class on the outermost If there's more to consider then I can make a followup issue, but could possibly be a quick enough addition for this PR |
|
@thatblindgeye if you rebase this PR, the a11y errors should go away since we removed the context selector component. |
9c50832 to
0f01d3e
Compare
|
@thatblindgeye @andrew-ronaldson do we want badges and other actions in the utilities element to be centered vertically all the time for both single-line and multi-line text input group layouts? Or should everything be vertically centered in a single-line text input group, but be start aligned (vertically centered with the first line of content) in a mult-line text input group? |
mattnolting
left a comment
There was a problem hiding this comment.
Great work @thatblindgeye! Only thing I'm noticing is icon positioning. Following comments will address.
Before:
Update:
src/patternfly/components/TextInputGroup/text-input-group-template-status.hbs
Outdated
Show resolved
Hide resolved
|
|
||
| &.pf-m-icon { | ||
| --#{$text-input-group}__text-input--PaddingInlineStart: var(--#{$text-input-group}__main--m-icon__text-input--PaddingInlineStart); | ||
| } |
There was a problem hiding this comment.
| } | |
| display: inline-flex; | |
| align-items: center; | |
| justify-content: center; | |
| min-width: calc(var(--#{$text-input-group}__LineHeight) * --#{$text-input-group}__FontSize)); | |
| } |
There was a problem hiding this comment.
Add these to :where(:root)
--#{$text-input-group}__LineHeight): var(--pf-t--global--font--line-height--body);
--#{$text-input-group}__FontSize: var(--pf-t--global--font--size--body--default);
There was a problem hiding this comment.
Add these to .#{$text-input-group}
line-height: var(--#{$text-input-group}__LineHeight);
font-size: var(--#{$text-input-group}__FontSize);
mcoker
left a comment
There was a problem hiding this comment.
Looks fantastic. I left some comments and am also curious about a couple of things:
- We're drawing the border on the outer text input group wrapper from the child
__mainelement. That works now, but if we need to addposition: relativeto__main, we'll no longer be able to create the border from__main. Can we move both the status modifiers and the visible border to the outer.pf-v6-c-text-input-groupelement? - What's the role of
.pf-m-status? One thing is I see we're adding selectors like.thing:where(.pf-m-success, .pf-m-error, ...)... we could require.pf-m-statusto be used with any kind of status on an element likeclass="pf-m-status pf-m-error", and then instead of listing all of the classes in our selector, we could just target.pf-m-status.
src/patternfly/components/TextInputGroup/text-input-group-template-status.hbs
Outdated
Show resolved
Hide resolved
| --#{$text-input-group}__text--BorderStartEndRadius: var(--#{$text-input-group}__text--BorderRadius--base); | ||
| --#{$text-input-group}__text--BorderEndEndRadius: var(--#{$text-input-group}__text--BorderRadius--base); | ||
| --#{$text-input-group}__text--BorderEndStartRadius: var(--#{$text-input-group}__text--BorderRadius--base); | ||
| --#{$text-input-group}__text--Position: initial; |
There was a problem hiding this comment.
This probably isn't doing what you intend? Using initial as the value for a css custom property will force the fallback to be triggered in any var() function where it's used.
For example, this will make .thing have a background color of "red"
--background: initial;
.thing {
background: var(--background, red);
}
If you wanted "initial" as the default value for the position prop where this is used, you'd just leave --#{$text-input-group}__text--Position undefined by default, and use "initial" as the fallback directly in the property declaration:
.#{$text-input-group}__text {
position: var(--#{$text-input-group}__text--Position, initial);
Though I'd recommend using "revert" instead of "initial" - it's fine here, but "initial" doesn't always return what you're looking for. For example, if you had like div { display: initial; } it would change div to have display: inline since "inline" is the initial value for display
0f01d3e to
b64c26b
Compare
b64c26b to
a33ec31
Compare
|
Changes look good Eric! I will close the related issue for the border-radius |
|
🎉 This PR is included in version 6.0.0-alpha.184 🎉 The release is available on: Your semantic-release bot 📦🚀 |




Closes #6654 , closes #6796