Issue #3388Opened April 5, 2021by ahmedderkaoui1 reactions

FEAT: adding indication as a Trait without any input.

Question

I want to add an indication for a trait.

For my component, I have the traits:

traits: [
            'placeholder',
            'dateformat',
            {
              type: 'dateformat-indication',
            },
],

and for the type 'dateformat-indication', I created the type:

editor.TraitManager.addType('dateformat-indication', {
      noLabel: true,
      templateInput: `
        Date format indications:
        <ul>
              //SOME INDICATION
        </ul>
      `,
});

However, I get an input within this type that I created even if it wasn't on its template:

git

Is there a way to disable default input of the trait?

Answers (1)

ahmedderkaouiApril 5, 20211 reactions

Using the method below works fine:

editor.TraitManager.addType('dateformat-indication', {
      noLabel: true,

      createInput({ trait }) {
        const el = document.createElement('div');
        el.innerHTML = `
              //TEMPLATE
        `;
        return el;
},

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.