Issue #3375Opened March 31, 2021by christosapos0 reactions

Cannot add spaces to extended button component based on text component.

Question

Code SnippetTEXT
Hello guys,

First of all i would like to express my gratitudes for this amazing tool. I have extended button component based on text component so as to can edit the content of button manually without using traits.
The code for the extended button component is this:

var comps = editor.DomComponents;
var defaultType4 = comps.getType('text');  
    
editor.DomComponents.addType('button', {
  
 model:{
      defaults: {
          tagName: 'button',
          classes: ['.pointer'], //Add click pointer on hover,
      },
 },
 
  extend: 'text',
  isComponent: function (el) {
      if (el.tagName === 'BUTTON')
          return {type: 'button'};
  },
  view: defaultType4.view.extend({

    events: {
      dblclick: 'onActive',
      input: 'onInput',
      dragstart: 'handleDragStart',
      click: function() {
         /*Click function */
      }
    },
  })  

})

At this point i am capable of edit content of button components manually. Now the problem that i am dealing with is that i can not add space characters inside content of buttons.Can anyone help me ?

Answers (1)

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.