Issue #3388šŸ’¬ AnsweredOpened April 5, 2021by ahmedderkaoui1 reactions

Adding indication as a Trait without any input.

Quick answerby ahmedderkaouiā¤ 1

Using the method below works fine:

Read full answer below ↓

Question

I want to add an indication for a trait. For my component, I have the traits: and for the type 'dateformat-indication', I created the type: However, I get an input within this type that I created even if it wasn't on its template: Is there a way to disable default input of the trait?

Answers (2)

ahmedderkaoui• April 5, 2021

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;
},
GJSBlock• May 17, 2026

Thanks for reporting this, @ahmedderkaoui. Great question about FEAT: adding indication as a Trait without any input.. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener meth...

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.