I'm not sure if this works as designed, but after I checked the "Load a pre-built option list", selected US states for example, and save it, I can't edit it anymore; everything seems fixed. For instance, I can't uncheck "Load a pre-built option list" when I got a bug related to the option element module, or uncheck Allow "Other..." option.

Also, I set the label inline, but it displays as above.

Screenshots are attached.

Thanks again!

Comments

Title:UI experienceSelect label set to inline but displays above
Project:Options Element» Webform
Version:7.x-1.7» 7.x-3.x-dev
Category:support» bug

The second issue is a Webform issue, not an Options Element issue.

Status:Active» Closed (fixed)

sorry for that. Thanks for letting me know about this.

Status:Closed (fixed)» Active

I closed this issue at options_element module page as it seems that it's a webform issue, so I re-open it here. Sorry it I shouldn't.

Thanks

I can't reproduce this problem. The label element should be contained in a div element with @class webform-container-inline. That class should give the label display: inline. Please use a tool like Firebug to check your stylesheet to see if there is something overriding that style rule.

Hi Liam, it' great to hear from you. I used firebug and checked, but it seems that there is no overriding for that part.

Also, I don't know if this is relevant, but when I unchecked Allow "Other..." option, the label goes inline, which is I want, but whenever I check that, the selection area just drops down as the screenshot shows. Do you think this means anything particular?

Thanks~

Project:Webform» Select (or other)
Version:7.x-3.x-dev» 7.x-2.x-dev
Component:User interface» Webform
Status:Active» Needs review
StatusFileSize
new1.4 KB

Yes, that is very relevant. The attached patch fixes the problem with a small change to Select (or other).

Hi Liam, thanks for the patch. That's awesome! It perfectly fixes the problem. Thanks again for the effort!

Why does webform use a #title_display value of 'inline' instead of 'before'? Would it not be better to fix that in webform?

Inline has the label display to the left of the form control. Before has it display above.

To be more clear: Webform supports "inline", "before", and "none". "before" means above and "inline" means next to it. The Webform-specific theming function handles "inline" but the regular theming function used to expand the Select (or other) control does not so we have to convert "inline" to "before". Webform will still add the CSS class that does the inline display.

Oh I see 'inline' is something extra webform supports that is not normally in FAPI?

It does appear there is a bug with #title_display in select_or_other based on what I see in your patch, however supporting 'inline' explicitly on this side of the integration seems out of place since that is a webform specific feature.

Title:Select label set to inline but displays aboveWebform select label set to inline but displays above in Select (or other)
Project:Select (or other)» Webform
Version:7.x-2.x-dev» 7.x-3.x-dev
Component:Webform» Code
StatusFileSize
new1.29 KB
new1.42 KB

I see what you mean. Attached is a patch for each of Select (or other) and Webform; both patches together fix the issue and keep the inline-specific code in Webform.

Status:Needs review» Needs work

There are still lots of other components that use #title_display = 'inline', we can't just change theme_webform_element() based on select lists, since it's used for all components. Switching the #title_display property for select_or_other in webform_expand_select_or_other() seems like a good alternative approach, as that's where Webform makes its other adjustments to select_or_other to make it work with Webform.

Status:Needs work» Needs review
StatusFileSize
new936 bytes
new854 bytes

Thanks, quicksketch. Here is another pair of patches using webform_expand_select_or_other().

Thanks Liam. I've committed your patch. Select or other's next dev snapshot will set the #title_display on the select list that is passed to the parent element too.
Note that you can also set this property on the 'other' field using #other_title_display on the parent element.

Status:Needs review» Fixed

Thanks both Liam and danielb: Committed the Webform portion to both 3.x branches of Webform.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.