twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
170.48k stars 78.84k forks source link

`.col-*` classes don't work in input groups #33942

Open cq8j6le8rk59g6g1q43k682hmz opened 3 years ago

cq8j6le8rk59g6g1q43k682hmz commented 3 years ago

`

</div>`

This is the code in version 4 it worked

ffoodd commented 3 years ago

Bug reports must include a live demo of the issue. Per our contributing guidelines, please create a reduced test case via CodePen or JS Bin and report back with your link, Bootstrap version, and specific browser and operating system details.


This is a saved reply.

cq8j6le8rk59g6g1q43k682hmz commented 3 years ago
ffoodd commented 3 years ago

Got it, thanks :)

So based on this, it appears to relate to our cols using width in v5 instead of max-width in v4, and our custom select overriding both width and flex when in an input group.

Not sure how to / if we should tackle this honestly. Any thought, @twbs/css-review ?

cq8j6le8rk59g6g1q43k682hmz commented 3 years ago

class: m-col = max-width; class: col = width;

mdo commented 3 years ago

Created two fresh CodePens to remove the card markup:

I'm not sure how we fix this yet, but I do believe it's something we should support. Wonder if there's an alternative solution to how we size those elements within the input group.

ffoodd commented 3 years ago

The main issue IMHO is that input groups act as rows, where we could expect them to simply impact borders and spacing. What was the reason to switch our columns to width instead of max-width already?

Not quite sure of the way to go either. There're a few ways though:

  • working around specifity so that width applies correctly (!important on .col-* or setting width: 1% on universal selector in input group to lower specificity)
  • restoring max-width on columns
  • dropping flexbox layout from input-group and requiring rows and cols (BC)
  • etc.

I guess we might find some other ways, using grids or tweaking things around—but I'd say we have a first thing to tackle: what do we expect both input group and columns to do, especially together?