Email element does not have default #ajax event

Created on 14 June 2019, about 6 years ago
Updated 19 August 2025, 5 days ago

Problem/Motivation

When RenderElement::preRenderAjaxForm processes #ajax, it assigns default triggering events based on element types.

Currently, all text inputs check for the blur event:

        case 'password':
        case 'textfield':
        case 'number':
        case 'tel':
        case 'textarea':
          $element['#ajax']['event'] = 'blur';
          break;

The email input is missing. When adding #ajax to an email element, nothing happens.

I'm assuming this falls under the render system since it is part of the processing system rather than actual AJAX.

Steps to reproduce

Proposed resolution

Add email to the switch case above.

Remaining tasks

Do it
Add test coverage that it's there?

User interface changes

NA

Introduced terminology

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

render system

Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

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