You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please add :focus-within class like .focus-within with the same styles like .form-control:focus. This allows to e.g. implement custom input components thich uses input as child and as parent a div. The div should then look like an input element which already works with .form-control. With focus-within it would mock it perfectly.
Motivation and context
Currently I crafting a custom input component for tags (aka chips or labels), because Bootstrap has none. I have a blank input element as child and the div parent - which also holds the chips - should look like the input.
// Avoid using mixin so we can pass custom focus shadow properly
box-shadow: $input-focus-box-shadow;
}
}
This exact styles should be use for the .focus-within:focus-within. Or we could just use: .form-control:focus-within Because the focus styles related on the base class. I see no reason, why not. As I can see, the form-control class is only used for input element, which never have childs. Otherwise the .focus-within class needs the same styles like .form-control.
The solution is easy:
- &:focus {+ &:focus, &:focus-within {
Example solution to make a div which has an input (styleless) within look like an input:
Prerequisites
Proposal
Please add
:focus-within
class like.focus-within
with the same styles like.form-control:focus
. This allows to e.g. implement custom input components thich uses input as child and as parent a div. The div should then look like an input element which already works with.form-control
. With focus-within it would mock it perfectly.Motivation and context
Currently I crafting a custom input component for tags (aka chips or labels), because Bootstrap has none. I have a blank input element as child and the div parent - which also holds the chips - should look like the input.
More information
bootstrap/scss/forms/_form-control.scss
Lines 34 to 45 in fecd219
This exact styles should be use for the
.focus-within:focus-within
. Or we could just use:.form-control:focus-within
Because the focus styles related on the base class. I see no reason, why not. As I can see, the form-control class is only used for input element, which never have childs. Otherwise the.focus-within
class needs the same styles like.form-control
.The solution is easy:
Example solution to make a div which has an input (styleless) within look like an input:
Try it out in the live demo!
The text was updated successfully, but these errors were encountered: