Use label & description for captcha label & description instead of custom structure

Created on 2 May 2023, over 1 year ago
Updated 9 May 2023, over 1 year ago

Problem/Motivation

Currently CAPTCHA 2.x uses a structure like this for the description:

<fieldset data-drupal-selector="edit-captcha" class="captcha captcha-type-challenge--recaptcha">
  <div class="captcha__description">This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.</div>
  <div class="captcha__element">
    <input data-drupal-selector="edit-captcha-sid" type="hidden" name="captcha_sid" value="yyy">
    <input data-drupal-selector="edit-captcha-token" type="hidden" name="captcha_token" value="xxx">
    ...
  </div>
</fieldset>

but instead it seems it would make more sense to perhaps use the same structure as Drupal uses for form fields with

  • label
  • div.description

so that the default style applies.

A good example is the login form: /user/login which currently looks like this, (if no label is used):

I'd instead expect the long text as description and the label (if set) as label.

We should hurry up to improve this, as long as 2.x isn't that widely used. It will be a BC anyway, but won't hurt that much, if we do it early.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Comments & Activities

Production build 0.71.5 2024