trait validation
Question
Is there way to restrict trait length i.e title cannot be more than 255 chars and if user try to add more than that, should display error message?
Answers (3)
Hi @krunal039,
The only way I know to do something like would be to make a custom trait and use the getInputEl function to either set a maxlength property on your input or create a section show whatever errors that you want.
The only way I know to do something like would be to make a custom trait
Correct
@ryandeba @artf , thanks for reply, is there way to pass property(max length, validation error message) to custom traits?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #577
Only allow one component of specific type on editor
is there way to not allow to drop any specific component more than one time on page? I have custom component and user cannot drop it more t...
Issue #1227
Re-render view in editor's canvas whenever Trait value changes
Is there any possible way in grapesjs that whenever a user changes the value of a Trait of a custom component the render function should li...
Issue #455
Need help: Ask for user input for text/imageurl/hyperlink
we are building template where it will render div with background image and on hover it will display some text, also there will be hyper li...
Issue #1589
[Bug] Cannot read property '_cash(some random numbers)' of undefined on newsletter demo.
I'm having some issue when I load some templates and modify. and it looks like grapesjs newsletter demo is also having this issue. I have c...
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.