Why does text input not shrink
I have this code, why does the text input not shrink according to its parent, it causes an overflow
15 Replies
the default width of inputs is 300px
you have to explicitly set it to 100%
or, use a proper css reset, which usually solve this type of weird edge cases
you can also set the inputs to
min-width: 0;
if you don't want them to growthe code has
min-w-0
, which i assume it is the tailwind way of doing thatI mean that should work 🤷♂️
the parent also has
min-w-0
yea just saw that
gah I hate reading tailwind
same
even worse in that plain code syntax 😂
the pretty colors help a lot
Either way a reply is always best heheh
I will give TW that you don't need to look at two different spots to "kinda" know whats going on. But nothing beats just having devtools and knowing how things work hah
and that is where TW gets worse for me too hah
but yea idk I just testing min-width and it works fine in normal css/html so makes me think there is something else going on
wait nvm 🤔 not alone
has to be a flex or grid child 🤔
it is a flex or grid child for
md
sized devices
<div className="md:flex
<-- the first classI mean yea and width: 100% would work if it wasnt
https://codepen.io/b1mind/pen/XWvNjyJ
the problem is when it shrinks
so, when it isn't in flex, it is overflowing, at some point
cool, thank you guys
sorry for the weird ass code im just trying to hack something together 😭
it's lot your fault
all tailwind code looks like shit, so, don't worry