You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I perform a spellcheck in Firefox, tbwchange fires.
However, if I get editor content using $('#my_trumbowyg_id').trumbowyg('html'), the value returned is the content of the editor before I ran the spell check.
If I enter any additional content in the editor manually, then $('#my_trumbowyg_id').trumbowyg('html') begins to return the correct value.
Console logs the editor content still including the original misspelt string
Type a space after the correctly spelt string displaying in the editor
$('#my_trumbowyg_id').trumbowyg('html')
Console logs the correct editor content.
The text was updated successfully, but these errors were encountered:
Duberry
changed the title
Firefox spell check fires tbwchange but content does not post
Firefox spell check fires tbwchange but content does not update until manual input
Feb 24, 2024
Hi Alex-D. I see you have tagged this as a bug. Do you have any feedback on when it might be resolved or a pointer for the code causing it so that I could look at a fix?
(function($){// Extend jQuery to include a function to get Trumbowyg content$.fn.getTrumbowygContent=function(){// Find the closest '.trumbowyg-box' parent to ensure we're working within a Trumbowyg editorvartrumbowygBox=this.closest('.trumbowyg-box');if(trumbowygBox.length){// If a '.trumbowyg-box' is found, find the '.trumbowyg-editor' within it to get the contentvareditor=trumbowygBox.find('.trumbowyg-editor');returneditor.html();// Return the HTML content of the 'trumbowyg-editor'}else{// If no '.trumbowyg-box' parent is found, log an error and return an empty stringconsole.error("No Trumbowyg editor found in the ancestor elements.");return'';}};})(jQuery);
Then when you want to retrieve the Trumbowyg content, call $('#your_textarea_id').getTrumbowygContent()
When I perform a spellcheck in Firefox, tbwchange fires.
However, if I get editor content using $('#my_trumbowyg_id').trumbowyg('html'), the value returned is the content of the editor before I ran the spell check.
If I enter any additional content in the editor manually, then $('#my_trumbowyg_id').trumbowyg('html') begins to return the correct value.
Description
How to reproduce?
$('#my_trumbowyg_id').trumbowyg().on('tbwchange', function() {console.log('change');});
Type misspelt string
Use spell check to correct string spelling
console.log($('#my_trumbowyg_id').trumbowyg('html'))
Type a space after the correctly spelt string displaying in the editor
$('#my_trumbowyg_id').trumbowyg('html')
The text was updated successfully, but these errors were encountered: