Vue HtmlEditor - Keyboard Support

Users can use the following keys to interact with the UI component:

PCMacAction
Ctrl + C⌘ + CCopy
Ctrl + V⌘ + VPaste
Ctrl + Z⌘ + ZUndo
Ctrl + Y⌘ + YRedo
Ctrl + A⌘ + ASelect All
Ctrl + B⌘ + BBold
Ctrl + I⌘ + IItalic
EnterInsert a line break (a new paragraph)
Shift + EnterInsert a line break (in the same paragraph)
TabNest current list item (when in a list)
Increase indentation (when at the start of a paragraph)
Move the cursor to the next table cell
Shift + TabMove the cursor to the previous table cell
Decrease indentation (when at the start of a paragraph)
↑ → ↓ ←Navigate through the table
EnterMove the cursor outside the table (when in the last row)
EscClose active dialog
EnterApply active dialog data

You can implement a custom handler for a key using the registerKeyHandler(key, handler) method.

Code
  • <template>
  • <DxHtmlEditor :ref="myHtmlEditorRef" />
  • </template>
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxHtmlEditor from 'devextreme-vue/html-editor';
  •  
  • const myHtmlEditorRef = 'my-html-editor';
  •  
  • export default {
  • components: {
  • DxHtmlEditor
  • },
  • data() {
  • return {
  • myHtmlEditorRef
  • }
  • },
  • computed: {
  • htmlEditor: function() {
  • return this.$refs[myHtmlEditorRef].instance;
  • }
  • },
  • mounted: function() {
  • this.htmlEditor.registerKeyHandler('backspace', function(e) {
  • // The argument "e" contains information on the event
  • });
  • this.htmlEditor.registerKeyHandler('space', function(e) {
  • // ...
  • });
  • }
  • }
  • </script>
See Also