Center the dropdown icon added to an input with a paired datalist in Chrome #18511
+35
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tweaks the dropdown arrow added to an input by Chrome when it has a
list
attribute pointing to a<datalist>
.Right now the arrow isn't centered vertically:
The cause of this is the line height being inherited into the pseudo element which controls how the marker is positioned. I think this is because it's being drawn with unicode symbols but I'm not sure. It could just be from the
list-item
display.After this PR changes the line height its centered again:
Some notes:
This only affects Chrome and also does not appear to cause issues for date/time inputs. While weird that this pseudo is the one used for a
<datalist>
marker it is indeed correct.Fixes #18499
Can use this Play to test the change: https://play.tailwindcss.com/jzT35CRpr0