-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Input group tests and tweaks #25352
Input group tests and tweaks #25352
Conversation
- In an effort to better support form validation in input groups, the selectors with which we target inputs, selects, and appends/prepends have been significantly overhauled. - No official backward compatibility has been lost, but it's important to note this does limit the flexibility of the input groups for validation. There's simply no way around it with today's CSS selector support. - Generally speaking, this provides fewer overrides, aims to isolate normal inputs/selects/files from validated ones, and reduces our overall amount of CSS needed.
I've pushed the CSS changes now. Here's where we stand with rendering validation styles in input groups for text inputs and textareas, custom selects, and custom files. Note that custom files cannot have feedback text or tooltips; their markup makes it an immediate no-go. With these complex CSS changes and clever selectors, nothing is lost in promised support so there's technically no backward incompatibility. However, this CSS does clarify just how far we can go with this component given today's CSS selectors. I was hoping to have this done for v4 stable, but it'll have to roll out after. I'm going to open a PR to make a note of this bug in the docs and link to the tracking issue. @ysds I know this isn't perfect, but it's the best we can do. These new selectors are the most effective at separately targeting normal inputs/selects/files and validated ones. |
Let me confirm very soon. EDIT: The following case seems broken. <div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Text</span>
</div>
<input type="text" class="form-control is-invalid">
<div class="input-group-append">
<span class="input-group-text">Text</span>
</div>
</div>
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text">Text</span></div>
<select class="custom-select is-invalid">
<option selected="">Custom select</option>
</select>
<div class="input-group-append"><span class="input-group-text">Text</span></div>
</div>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Text</span>
</div>
<input type="text" class="form-control is-valid">
<div class="valid-feedback">
Example valid feedback text
</div>
</div>
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text">Text</span></div>
<select class="custom-select is-valid">
<option selected="">Custom select</option>
</select>
<div class="valid-feedback">
Example valid feedback text
</div>
</div> |
Working on those now. I just pushed a commit to resolve the valid feedback one; I had the wrong class in the selector ( |
The following no feedback-text case are not supported? <div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Text</span>
</div>
<input type="text" class="form-control is-invalid">
<div class="input-group-append">
<span class="input-group-text">Text</span>
</div>
</div>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Text</span>
</div>
<input type="text" class="form-control is-valid">
<div class="input-group-append">
<span class="input-group-text">Text</span>
</div>
</div> |
I'm unsure just yet on those... it's what I'm trying to work through now. This is the only situation where, so far, I don't think we can differentiate these two situations: In both examples, the input is the second child, is the second from the last child, and comes after a prepend. There's no selector support for changing what we're using |
Your effort deserves praise. It is up to you to release V4 with some limitations. We have a great utility |
- "input-group-lg" | ||
--- | ||
|
||
<style> |
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.
@mdo: you need to move this to docs CSS file.
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.
Yup yup, just putzing around for now :).
Closing as stale for now. |
This PR is adding a new
docs/4.0/examples/tests/
folder to house more complex and dense kitchen sink examples of all the supported variations of a component. Perhaps there's a better location, so I'm open to moving this in the future.For now, I'm using this to test additional input group tweaks in hopes of fixing our rounded corner issue from #25110. I'll split those commits out after verifying what we support is functioning as intended.