-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Add option to control input width (that works) #10311
Comments
Here's a fiddle (not sure what issue here as I can't even get the form-group to resize on fiddle). If one wanted this form layout but with smaller input field? http://jsfiddle.net/tX3ae/ |
Still doesn't work. Now you've constrained the entire form to that size. http://jsfiddle.net/tX3ae/8/ - make the top 2 short and the rest long. If the top two are too short they wrap together next to one another. |
(drinks more coffee) |
You need to add something such as this so we can control width. Even if the col-sm-x weren't overridden by the form-control it still causes the float.
|
Honestly, I'd suggest using |
Shazam!: http://jsfiddle.net/tdUtX/2/ |
Yes but now look at all the extra markup. Isn't that a bit ridiculous? I think that having a form with name, email (short fields) followed by a full width subject/message is pretty trivial/common. Having to use a grid for something that doesn't require one just because someone wanted to remove input width control is a bit lame imo. I've added the above code to my own build but honestly would like to see some effort towards getting that in the codebase. |
Either that or rework things so that things like col-sm-x etc can work directly on inputs without float issues. |
Stick a form control in a col--???
Many Thanks On 30 Aug 2013, at 23:39, Yashua [email protected] wrote:
|
Well yes you can - and that is what @cvrebert has in the fiddle. I can certainly see the use of rows/grid for complex form layouts (i.e. a mix of horizontal and stacked fields) but to pretty much always have to use a grid is not wonderful by any means. And I think the contact form scenario I illustrated is a very common one. Frankly I don't understand why it's a big deal to have width control on inputs. |
This is how we're doing it now, @cyberwombat. It's more verbose for sure, but it was a trade off we made with the percentages and the new grid system. For now, use the grid classes as @cvrebert has mentioned. In the future we can explore resets for form controls (we do have them for tables, but those are a slightly different story). We'll need to see how that impacts building out forms with some examples, test out the behavior, see how it clashes with existing form groups/controls/layouts, and more. Folks will inevitably want to mix and match, and that's another can of worms. In time, but not yet. I'll make a note to revisit this for 3.1 (no time table on that yet) in our planning issue, #9397. |
Thanks. Appreciate having that on the planning list. |
I was just looking for this today. Glad this is on the planned list. |
The problem with @cvrebert's fiddle is that it doesn't cover the case where the label is longer than the input field and horizontal doesn't make sense when most fields require 100% elements. |
@akrabat In my 2nd fiddle (I assume you're not referring to the broken first one), if the label is longer than the input field, then it'll just wrap onto a new line like you'd normally expect. |
yes - which doesn't makes sense when there's all that room on the same line. It's the input field that needs to be short as it's only allowed up to 5 characters, not the label which is 25 characters. For now, I've put a width directly on the input :) |
That form format was specifically designed to always keep the labels above the input fields, so it's not really fair to criticize it for doing that. Locking this issue since it naturally concluded almost a year ago. |
According to docs one would use .col-lg-x on the .form-group. While it does constrain the input field it also cause every subsequent element to float next to it so that is not a useable solution. Applying the .col-lg-x class to the input field themselves does not work. Currently the only workable solution is to use style="width:X" which is hardly wonderful. Please add a way to control input widths.
The text was updated successfully, but these errors were encountered: