There's this code in bootstrap/src/Plugin/ProcessManager.php:

if ($e->isType(['color', 'date', 'number', 'range', 'weight'])) {
      $e->addClass('form-inline', 'wrapper_attributes');
    }

Why would one want the label to be in front of the input while rest of the form is not? Strange behaviour. Could we not do this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hkirsman created an issue. See original summary.

hkirsman’s picture

Issue summary: View changes
markhalliwell’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Category: Task » Support request
Status: Active » Closed (works as designed)

Because these are small inputs. Bootstrap, by default, increases an input to the full width of the container.

hkirsman’s picture

For placeholder and future reference, there should be an option to disable this because it might look weird on some layouts.

markhalliwell’s picture

That's what sub-theme preprocessing is for.

Christopher Riley’s picture

Not to beat a dead horse, but in my opinion shouldn't this be an option on the field and not a blanket theme decision? Yes we can certainly overwrite it in our custom theme however isn't this an assumption that will break features in both core and some modules such as Webform?

Korben_Dallas’s picture

FWIW
Doing sub-theme processing to fix this seems like a lot of unnecessary work (and is discouraging to non-developers) considering that the form field display settings already has specific label position options: Above, Inline, Hidden and Visually Hidden. The theme is not respecting these settings and a user has valid and understandable expectations that it should.

chrisolof’s picture

On the off-chance consistent field display is ever desired, and to help folks out in the short term, patch attached :)

RickZebra’s picture

I just applied the patch on #8 which fixed the issue but, it broke my wrapper css. I have tried multiple times to add a wrapper css class on some of my fields and when I save the form, it seems to erase my classes.

Nevermind, I see now that I needed to add a custom class in order to set my columns. Patch worked great.

markhalliwell’s picture

AaronBauman’s picture

Can anyone comment on exactly how they addressed this in the subtheme process layer?
I'm tired of doing this on every new subtheme and then forgetting how to do it 3 months later.

gagarine’s picture

Category: Support request » Bug report
Status: Closed (works as designed) » Active

This feature cause unattended consequences in different module like webform #2910776: Telephone Field, Title display Before same as Inline.

Like pointed in #7 their is already settings to manage label alignment. Making this hard coded in the bootstrap theme break those settings.

Please remove it.

markhalliwell’s picture

Status: Active » Closed (duplicate)