Closed (works as designed)
Project:
Drupal core
Version:
7.x-dev
Component:
markup
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Jul 2008 at 02:19 UTC
Updated:
16 May 2010 at 01:06 UTC
Jump to comment: Most recent file
Comments
Comment #1
cburschkaI'm a bit doubtful over your 360px declaration. Is there no way to use a relative value that would be guaranteed to work on all resolutions and window sizes?
Comment #2
damien tournoud commentedHey, I like that!
Typography has known for a long time that you have to limit the number of words per lines to increase readability. In most cases, you should not put more that 55-60 characters per lines [see 1, which is a good synthesis].
What we could do is use
form#comment-form { width: auto; }, and let the browser size the box based on its#sizeparameter.[1] http://papunet.net/selkokeskus/fileadmin/tiedostot/muut/Itkonen.pdf
Comment #3
cwgordon7 commentedPatch rerolled per #2.
Comment #4
cburschkaThis works very nicely. Screenshot attached.
Comment #5
acMy 2c; this is the job of the theme. I am also not sure having float:left or float:right on a form element in core is a good idea. Could you perhaps use some other element?
Comment #6
webchickI agree with ac. We get endless complaints about core providing styles that themers then have to override. Core should only be handling overall things like making sure columns are showing up where they say they should be, but shouldn't manage anything having to do with the *display* of things on the page.
Comment #7
damien tournoud commented@webchick: well it does already. Why do you think there is a
width: autoin the patch in #3? Because the core default is to set field widths to the maximum available width... Point taken on thefloatpart.Comment #8
webchickI'd prefer putting the
width: autoon the textfield/texarea element styling (or removing thewidth: 100%or whatever's there now) and having the #size property actually /do/ something, personally, rather than just "fixing" this for comments.Comment #9
catchI agree with webchick on this - would rather remove the width: 100% - that's been the cause of quite a few support requests as well.
Comment #10
cwgordon7 commentedAgreed, let me re-roll.
Comment #11
cwgordon7 commentedOn second thought, getting rid of that might not be the best idea - see attached screenshot.
Comment #12
cburschkaYes, that is what I thought.
Perhaps the '#size' parameter should accept a percentage string too, which will be applied as a width instead of a size?
Or the node text area needs [attributes][width] set to 100% directly.
Comment #13
Nick Lewis commentedThis patch needs work, and may create issues in the process of solving the wrong problem. First, technical problems with the patch itself:
1. IE 6 is unaffected by the changes in this patch. The reason why is any body's guess. I do know that IE6 has some weird opinions on what "width:auto;" is supposed to do.
2. Why "float:left;" worked to restore the default width is a mystery: it only works for firefox (and presumably safari). Doesn't sound like anyone knows why this works in firefox. These kinds of fixes (where no one understands why they fix something) usually mean that we are fixing the wrong thing.
But none of that matters, because the plot thickens:
1. In IE6, Firefox, and Safari adding " '#resizable' => false " to the comment textarea duplicated the results of this patch on firefox (without any of the CSS changes)
2. moving the resizable textarea caused the textareas themselves to respect the #cols attribute again -- try changing #cols on a resizable textarea and you'll find that it has no affect until you add " '#resizable' => false " to the textarea formapi array.
I think the culprit is the resizable textareas, not the comment module's CSS or form array. Did we know that that textareas don't respect '#cols' attributes if they are resizable?
Now, if we still want this patch as is to work on all browsers, the patch needs nothing more besides. Setting the width explicitly is easier to understand and override than floating left (for no apparent reason), and using the dubious width:auto; property. Who on earth would figure out that they are halfsized in one browser because it was width:auto+float:left?
Comment #14
cburschkaUm. Yeah. Kind of. I'd noticed that while experimenting a long while back, but forgot that it would be pertinent to this issue...
Comment #15
cwgordon7 commentedI am not sure exactly what the right solution is. If anyone else is, feel free to assign it to yourself... :/
Comment #16
Nick Lewis commentedWell.. it seems to me finding out why resizable text areas don't default to anything but 100% width is a start. Resizable textareas starting out the same width as non-resizable textareas in ie6,7,firefox, safari 3 is a hearty fix imho.
Comment #17
cwgordon7 commentedOh that one is easy. System.css:
So should we change the default?
Comment #18
catchWe should probably remove it entirely, and make sure cols is set to a sensible amount instead.
Comment #19
cburschkaGood idea. We might still have to separately set the node body form to 100%, though... setting it with cols will make it completely inflexible on fluid themes like Garland, where you can remove one or more sidebars.
Comment #20
Nick Lewis commentedIndeed, we'll want to spot check most every page that has a textarea. Its been a long time since we've seen their actual sizes...
Comment #21
webchickThe #textarea element does default to a size if one's not specified.
From system_elements():
Comment #22
Pushkar Gaikwad commentedso which is the best way to do it ? http://drupal.org/node/281669#comment-928254 seems to be doing the trick. but I just want to make changes for comments form only and not for all the forms, :(
Comment #23
sutharsan commentedMoving all usability issues to Drupal - component usability.
Comment #24
dave reidUsability component is no more. Moving to.. forms?
Comment #25
effulgentsia commentedLet's see if the "drupal.css" component brings us any help from CSS gurus.
Summary as I understand it:
1) Resizable textareas are given width:95% as per #17: why? Part of the reason is discussed in #331852: Change 95% textarea width to 100%.
2) We want textarea for node body to be full width, but textarea for comment body to be less wide. What's the best way to achieve this without putting too much theme decisions into non-theme CSS files (#6)? Seems like there's consensus around setting up CSS to just have textareas be only as wide as their #cols dictates. That gets us back to the 95% question.
Comment #26
cosmicdreams commentedI think this patch #735628: Resizable textarea behavior leads to unpredictable results will have some impact an the work being done here. Notably, part of that patch addresses the 95% width question.
Comment #27
sun.core commentedMoving "drupal.css" component issues to "markup".
Comment #28
jacineI disagree with this patch. This is a design decision. It should be up to the theme, and should not be imposed on everyone by core.
Also, setting the width to 100% (as opposed to 95%), like we are doing here #735628: Resizable textarea behavior leads to unpredictable results, is good because the themer will get the expected result when applying a width/padding/margin/whatever to the #comment-form.
Comment #29
effulgentsia commented@Jacine: awesome work on #735628: Resizable textarea behavior leads to unpredictable results! I agree that a non-theme CSS file should not set the width for comment textarea to a percentage (like 50%) or a pixel number (like 360px). So, I see 3 paths forward here:
1) Mark this "won't fix" or "by design".
2) Make core CSS set some/all textareas to not be width:100%, but instead to be as wide as the cols attributes of the textarea dictates: otherwise, what's the point of the cols attribute?
3) Move this issue to the "Garland" component.
Any other recommendations?
Comment #30
jacine@effulgentsia thanks :)
It's a tough call, but I say "by design" because I don't think there is a good way to implement #2 (see screenshots).
If a design needs to use the cols, width: x can be used where it's needed (which likely wont be everywhere). It's really easy to do, it's just not something core should be doing. If we were to try and make it work without applying the width, we would need to deal with the resizable textareas and it would be a total hack IMO, without much gain. It's just not worth it. If anyone disagrees or has a better suggestion for how to handle this, feel free to change the status.
Also, it could be moved to Garlands queue as a feature request, but I'm pretty sure that would get a "by design" too.
EDIT: err, the "Regular Textarea" labels should say "Resizable Textarea." oops.