Prefix is shown before description

Created on 8 July 2024, 7 months ago
Updated 20 September 2024, 5 months ago

Problem/Motivation

When creating a number field and filling in a prefix and description where the 'Description display' is set to 'Before', the prefix will be shown before the description instead of the field.

This results in unwanted behaviour when, for example, you've set the prefix to a currency (such as โ‚ฌ or $) and you want to display a description above the field. It will first show the currency symbol follow by the description and the input field. Instead you want to show the description first and the currency symbol right before the input field as it makes more sense.

Steps to reproduce

  1. Create a Webform with the Webform module.
  2. Create a 'Number' element.
  3. Fill in the description.
  4. Fill in the prefix.
  5. Set 'Description display' to 'Before'.
  6. Save the element and view the form.

Proposed resolution

Show prefix in front of field instead of in front of the description when 'Description display' is set to 'Before'.

This can be done by swapping lines 71-73 with 74-78 in the following file:
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/syste...

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Formย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡ณ๐Ÿ‡ฑNetherlands rroose

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs frontend framework manager review

    Used to alert the fron-tend framework manager core committer(s) that a front-end focused issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024