Theresa Arzadon-Labajo

Tab key in Drupal WYSIWYG

Posted by Theresa Arzadon-Labajo (tarzadon) on May 05 2010
Tech Stuff >> Drupal
When typing in Drupal's WYSIWYG editor (i.e. FCKeditor or TinyMCE), the tab key will be seen by the browser as a navigation tool and proceed to the next tab-stop which is outside of the textarea.

I installed the Firefox add-on "Tabinta" (Tabs in Textarea), but this only worked on plain HTML textareas, like this one: http://www.javaworld.com/javaworld/jw-06-1996/javascript/form_textarea.html

The FCKeditor source documentation on http://docs.cksource.com/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options/TabSpaces says:

TabSpaces

The TabSpaces function determines how many "spaces" will the cursor move or strictly speaking how many " " will appear in the HTML when pressing "TAB" on your keyboard. By default it is set to "0" so no action is taken when pressing the "TAB" button.

Example:

FCKConfig.TabSpaces = 5 ;

I inserted the line "FCKConfig.TabSpaces = 5" into sites/all/modules/fckeditor/fckeditor.config.js
I ran "drush updatedb" just to be sure.
Then I tested that the tab key indeed worked in an fckeditor textarea.

No luck with TinyMCE yet.


Last changed: Feb 27 2020 at 4:13 PM

Back