Issue #2722319: <textarea>s using Text Editor always fail HTML5 validation...
3 unresolved threads
Closes #2722319
Merge request reports
Activity
added 1 commit
added 1 commit
added 1 commit
- Resolved by Adam Nagy
- Resolved by Adam Nagy
added 1 commit
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) {
Please register or sign in to reply