Allow field prefix/suffix to keep the inline flow

Created on 20 March 2020, over 4 years ago
Updated 11 August 2023, over 1 year ago

The form API allows the use of field_prefix or field_suffix properties to add HTML markup to be displayed right before/after input elements. Usually, this is used to complement the field widget with additional information.

UIkit maintains visual alignment by expanding form inputs to fit the space available by default when using the .uk-input class, which means that other elements in the same container will be forced to a new line.

I think that, even if that keeps UI's consistency, under some circumstances where usability is also important the theme should allow other inline elements (like the aforementioned prefix/suffix information) to keep the flow. Take a look at this example, from the Captcha module:

After adding a couple of classes, it can change to this:

This, even if not as closer to the UIkit spirit, it's better for users because it keeps the information as a single visual group.

A patch with the suggested change is coming. All it does is checking for the existence of the #field_prefix or #field_suffix element properties and adds some classes accordingly.

✨ Feature request
Status

Fixed

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024