Problem/Motivation

When using a text area field with the ACE format, the field is marked as required. However, after saving the node and leaving the field empty, no validation error appears, and the field is not flagged as required. Checking the console logs reveals the following error:

field_name[0][value] is not focusable.

This indicates that the required validation is not being properly enforced because the field is hidden or not properly focusable.

Steps to reproduce

  1. Create a content type with a text area field that uses the ACE editor.
  2. Set the field to be required.
  3. Create a new node and leave the ACE field empty.
  4. Save the node.
  5. Observe that no validation error appears despite the field being required.
  6. Check the browser console and see the error: field[0][value] is not focusable.

Proposed resolution

Following the guidance from Drupal issue #1954968, the required validation should be removed from the hidden field to prevent this issue. Instead, validation should be handled at the JavaScript level or using proper visibility toggling.

Remaining tasks

  • Investigate if the ACE editor field is correctly initializing in all scenarios.
  • Modify the field validation logic to ensure required fields are validated correctly.
  • Ensure that hidden fields do not trigger required validation.
  • Test and confirm the fix in different browsers and scenarios.
  • Submit a patch or merge request with the fix.
  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ➖ Automated unit testing coverage
  • ➖ Automated functional testing coverage
  • ➖ UX/UI designer responsibilities
  • ➖ Readability
  • ➖ Accessibility
  • ➖ Performance
  • ➖ Security
  • ➖ Documentation
  • ✅ Code review by maintainers
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Release notes snippet
  • ✅ Release ace_editor-2.0.2

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

Issue fork ace_editor-3513683

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ahmad abbad created an issue. See original summary.

ahmad abbad’s picture

Issue summary: View changes

ahmad abbad’s picture

Status: Active » Needs review
ahmad abbad’s picture

Issue summary: View changes

rajab natshah made their first commit to this issue’s fork.

rajab natshah’s picture

Issue summary: View changes
Issue tags: +ace_editor-2.0.2
rajab natshah’s picture

Issue summary: View changes

✅ Released ace_editor-2.0.2

rajab natshah’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.