I'm using Redactor as a WYSIWYG and setting the html of the textarea with jQuery.
$('#description_full').redactor('code.set', 'text goes here', { start: true });
(Source: Textarea editor Redactor. Insert value with jQuery)
However, when the code is set using this (which works correctly) the focus also shifts to Redactor, which I'd like to disable. In the API documentation (https://imperavi.com/redactor/docs/api/code/) it appears that I can prevent the change callback with:
{ start: true }
Unfortunately, this is not preventing the callback which is focusing on the Redactor editor. Any idea what I'm doing incorrectly here?
Ultimately I've found that this is a limitation of Redactor. In order to prevent the callback we need to destroy the object and reinstantiate it with the updated text already inserted into the input field.