?
avatar dgt41
dgt41
17 Nov 2014

Based on the comments from @Hackwar and @Smanzi #5113 and #5112 we get wrong placement of tooltips on the labels:
screen shot 2014-11-17 at 12 15 04
screen shot 2014-11-17 at 12 15 19
screen shot 2014-11-17 at 12 20 02

avatar dgt41 dgt41 - open - 17 Nov 2014
avatar jissues-bot jissues-bot - change - 17 Nov 2014
Labels Added: ?
avatar dgt41
dgt41 - comment - 17 Nov 2014
avatar dgt41
dgt41 - comment - 17 Nov 2014

Quick and dirty solution here:
line 655 media/jui/less/forms.less

  // Float the labels left
  .control-label {
    float: left;
    width: auto;
    padding-top: 5px;
    text-align: right;
  }

Seems to fix the placement, but the minor drawback is that we loose the right alignment:

screen shot 2014-11-18 at 1 10 33

avatar dgt41
dgt41 - comment - 17 Nov 2014

screen shot 2014-11-18 at 1 23 29

avatar dgt41
dgt41 - comment - 18 Nov 2014

@nternetinspired Seth, can I ask for your expertise here? You have any good trick for this one?

avatar nternetinspired
nternetinspired - comment - 19 Nov 2014

Labels are, by default, block-level elements so they fill the width of their container. The tooltip is centred over the label element.

Really, this is a result of poor design, applying a tooltip to a label in a horizontal form wasn't envisaged by the Bootstrap team, clearly, and for good reason I'd say.

The technical fix (untested) is to force labels with tooltips, inside horizontal forms to be inline-block elements instead, eg:

.form-horizontal .hasTooltip {display: inline-block;}

However, I would suggest that, in this instance, a far better solution is to remove the tool-tips from those labels. Does anyone require a tool-tip explaining 'name, 'subject', 'email' or 'message' in the context of a contact form? No, they don't.

avatar nternetinspired
nternetinspired - comment - 19 Nov 2014

Quick test in dev tools:

screen shot 2014-11-19 at 09 59 01

avatar infograf768
infograf768 - comment - 19 Nov 2014

In many places the labels do need the tip though.

avatar dgt41
dgt41 - comment - 19 Nov 2014

#5136 this might be a dirty hack, but I think will solve the problem. It moves the tooltip to the left (16 pix right from left margin). All it needs is some hack to restore the inline label to be right aligned again!

avatar nternetinspired
nternetinspired - comment - 19 Nov 2014

In many places the labels do need the tip though.

Agreed. Just not here…

avatar nternetinspired
nternetinspired - comment - 19 Nov 2014

Thanks @nternetinspired for the quick solution. I think your approach is even better, less code. I’ll test it and i'll report here.

No worries. Yes, I always prefer solutions that require less code too :)

avatar dgt41
dgt41 - comment - 19 Nov 2014

@nternetinspired Seth I updated #5137 to reflect your solution. Thanks again!

avatar dgt41 dgt41 - close - 19 Nov 2014
avatar dgt41 dgt41 - change - 19 Nov 2014
The description was changed
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-11-19 21:05:08

Add a Comment

Login with GitHub to post a comment