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:

Is there a way to disable default input of the trait?
Answers (1)
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.
Issue #3732
BUG: comment component type do not support adding traits
i am working on a script that add a trait on all the component type , but the comment type do not have the prototype object. code
Issue #494
Place block as component programmatically
I've created a custom type, and a block is it possible to insert it into DomComponents by name or any other means? I don't want to be drag'...
Issue #2170
[QUESTION] Custom component - how to set editable to true
Hi, I've created a custom component type, but I am having some trouble making it editable. The component is a "span" with component type "t...
Issue #3185
[QUESTION] How to get the models trait of a component?
Hi there, I added a new type "array" to the TraitManager. So I can add several sub traits. On one point I have to check the traits of the m...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.