Maxlength message blinks when an ajax call happens within the form

Created on 7 April 2025, 18 days ago

Problem/Motivation

The maxlength message blinks when a ajax call happens in the current form. The Ajax call will currently trigger the 'detach' behaviour which will remove the maxlength message, with will then get attached again, causing the blink.

Steps to reproduce

* Install the Real-time SEO for Drupal module ( https://www.drupal.org/project/yoast_seo )
* Enable Real-time SEO for Drupal auto-update in the module settings
* Add Real-time SEO for Drupal field to a content type and a text area with CKeditor and the maxlength set to some value
* Type some text in the text area and wait for the debounce and see the maxlength message blink

* Should be reproducible with other Ajax-ing in the form but didn't dive that deep

Proposed resolution

Check the trigger in Drupal.behaviors.maxlength.detach to only detach on 'unload', see for example Drupal.behaviors.ViewsAjaxView.detach and Drupal.behaviors.nodePreviewDestroyLinks.detach

Remaining tasks

  • ❌ Get maintainer approval for the proposed resolution
  • ❌ Implement resolution
  • ❌ Write test coverage (contact a maintainer if you need help)
  • ❌ Maintainer review via the UI
  • ❌ Maintainer Code Review #1
  • ❌ Maintainer code review #2
  • ❌ Merge into dev branch, with credit to author and participants

User interface changes

No blinking

API changes

None

Data model changes

None

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇳🇱Netherlands Lendude Amsterdam

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024