Commit c72dc294 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2571755 by nod_, yched, mbaynton, drubb, swentel: Required text field...

Issue #2571755 by nod_, yched, mbaynton, drubb, swentel: Required text field with a Text Editor + AJAX form rebuild = unsubmittable form
parent 93cd09f6
Loading
Loading
Loading
Loading
+0 −16
Changes for core/modules/editor/js/editor.js: 0 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -238,15 +238,6 @@
   */
  Drupal.editorAttach = function (field, format) {
    if (format.editor) {
      // HTML5 validation cannot ever work for WYSIWYG editors, because WYSIWYG
      // editors always hide the underlying textarea element, which prevents
      // browsers from putting the error message bubble in the right location.
      // Hence: disable HTML5 validation for this element.
      if ('required' in field.attributes) {
        field.setAttribute('data-editor-required', true);
        field.removeAttribute('required');
      }

      // Attach the text editor.
      Drupal.editors[format.editor].attach(field, format);

@@ -275,13 +266,6 @@
   */
  Drupal.editorDetach = function (field, format, trigger) {
    if (format.editor) {
      // Restore the HTML5 validation "required" attribute if it was removed in
      // Drupal.editorAttach().
      if ('data-editor-required' in field.attributes) {
        field.setAttribute('required', 'required');
        field.removeAttribute('data-editor-required');
      }

      Drupal.editors[format.editor].detach(field, format, trigger);

      // Restore the original value if the user didn't make any changes yet.