Reputation: 5854
I want to add constant tab space indent when user press TAB.
tinyMCE.init({
selector: 'textarea',
indentation : '60pt',
plugins: 'textcolor print preview importcss searchreplace autolink autosave save directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable',
paste_as_text:true,
//menubar: false,
toolbar: 'bold italic underline strikethrough superscript subscript | fontselect fontsizeselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist checklist | forecolor backcolor',
//nonbreaking_force_tab: true,
setup : function(ed) {
ed.on('keydown', function(e) {
//
//
});
},
});
Upvotes: 1
Views: 2265
Reputation: 13744
TinyMCE has a plugin named Nonbreaking Space
that will (when configured appropriately) inserted 3 spaces when you press the TAB key:
https://www.tiny.cloud/docs/plugins/nonbreaking/#nonbreaking_force_tab
The documentation covers the complexities of making this change as they relate to other plugins like table
and lists
so I would urge you to read the documentation in its entirety.
One word of WARNING about doing this ...
Changing the TAB key in this fashion will make it very difficult for people who rely on the keyboard to exit the editor and move to another form field as the TAB key is how you would typically do so. If you want your form to be accessible this change will make that very difficult to accomplish.
Upvotes: 1