-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
<input type="color" class="form-control"> as colorpicker is displayed badly #18786
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
Comments
Neither IE nor Edge currently support |
There's a couple of inconsistencies with heights on elements. I've managed to fix these with a few explicit height declarations which normalizes select and input heights. This also works for input type color too. |
@patrickhlauke Edge nowadays (version 14) supports |
Agreed this needs addressing, but I don't think a fully custom (square) component like in the cross referenced PRs is the way to go. I think a modifier class or something similar to that would be helpful though for the browsers that do support it. |
There's been a lot of back and fourth on this issue. I would suggest removing support for the You can do a bit with pseudo classes, but it's still funky. Here's a pen: https://codepen.io/oktalk/pen/BRJKYd |
I've resolved it in our local build by setting the same height as on input[type=color].form-control {
height: $input-height;
} |
I fixed mine by using @gvangool's solution, but by setting the padding as 0px.
|
input[type=color].form-control { solved for me!! |
Since #26820, a height is added to the |
well, it would be good to isolate a reduced test case (without any non-bootstrap styles in the way), and trying to pin down which browsers/operating systems/etc it happens on. "sometimes" is a bit too vague to try and trouble-shoot |
When browsers such as Chrome and Firefox present a proper colorpicker UI for
<input type="color">
, if you use.form-control
on the input, it's displayed kinda weirdly.In Chrome, the padding scrunches the actual color swatch and makes it invisible:

In Firefox, the height of the input doesn't match the height of

<input type="text" class="form-control">
:Safari doesn't support color inputs, so it shows a plain text input, which looks fine.
I haven't tested on IE/Edge.
CC: @mdo
The text was updated successfully, but these errors were encountered: