Skip to content
Snippets Groups Projects

Issue #2722319: <textarea>s using Text Editor always fail HTML5 validation...

Open Issue #2722319: <textarea>s using Text Editor always fail HTML5 validation...
3 unresolved threads
3 unresolved threads

Closes #2722319

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Pradhuman Jain added 1 commit

    added 1 commit

    Compare with previous version

  • Adam Nagy added 1 commit

    added 1 commit

    Compare with previous version

  • Adam Nagy resolved all threads

    resolved all threads

  • 641 $context.find('[data-ckeditor5-id]').filter(':input'),
    642 ),
    643 ).each(function () {
    644 if (this.dataset.ckeditor5Id) {
    645 const editorId = this.dataset.ckeditor5Id;
    646 // Using setTimeout() to ensure all CKEditors are loaded.
    647 setTimeout(() => {
    648 const editor = Drupal.CKEditor5Instances.get(editorId);
    649
    650 if (editor) {
    651 $(once('ckeditor5-states-binding', editor.sourceElement)).each(
    652 function () {
    653 editor.model.document.on('change', function () {
    654 if (editor.getData() !== editor.sourceElement.textContent) {
    655 editor.updateSourceElement();
    656 $(editor.sourceElement).trigger('change', [true]);
  • 651 $(once('ckeditor5-states-binding', editor.sourceElement)).each(
    652 function () {
    653 editor.model.document.on('change', function () {
    654 if (editor.getData() !== editor.sourceElement.textContent) {
    655 editor.updateSourceElement();
    656 $(editor.sourceElement).trigger('change', [true]);
    657 }
    658 });
    659 },
    660 );
    661 }
    662 });
    663 }
    664 });
    665 },
    666 };
  • 677 717 Drupal.ckeditor5.saveCallback = null;
    678 718 }
    679 719 });
    720
    721 /**
    722 * Listen to states API "required" event to remove HTML5 "required" from a hidden CKEditor source element.
    723 */
    724 $(document).on('state:required', (e) => {
    725 if (e.trigger) {
    726 if (e.value) {
    727 const targetIsRequired = e.target.hasAttribute('required');
    728 const targetIsCkeditor5 = e.target.hasAttribute('data-ckeditor5-id');
    729 if (targetIsRequired && targetIsCkeditor5) {
    • Comment on lines +725 to +729

      we can probably use a selector in the delegated event listner something like

      $(document).on('state:required', '[required][data-ckeditor5-id]', (e) => {
        e.target.removeAttribute('required');
      });
    • Please register or sign in to reply
  • Théodore Biadala requested changes

    requested changes

  • Please register or sign in to reply
    Loading