Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|
Comments
Comment #2
hkirsman CreditAttribution: hkirsman commentedComment #3
markhalliwellBecause these are small inputs. Bootstrap, by default, increases an input to the full width of the container.
Comment #4
hkirsman CreditAttribution: hkirsman commentedFor placeholder and future reference, there should be an option to disable this because it might look weird on some layouts.
Comment #5
markhalliwellThat's what sub-theme preprocessing is for.
Comment #6
Christopher Riley CreditAttribution: Christopher Riley commentedNot 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?
Comment #7
Korben_DallasFWIW
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.
Comment #8
chrisolof CreditAttribution: chrisolof at Lima Solutions for CivicSolar, Inc. commentedOn the off-chance consistent field display is ever desired, and to help folks out in the short term, patch attached :)
Comment #9
RickZebra CreditAttribution: RickZebra commentedI 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.
Comment #10
markhalliwell#8 isn't going to happen.
If anything, something like #2868538: Allow overriding of elements that are automatically converted to "form-inline" will instead.
Comment #11
AaronBaumanCan 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.
Comment #12
gagarine CreditAttribution: gagarine as a volunteer commentedThis 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.
Comment #13
markhalliwell