We are using react-selectize component for a field. In this component you can add custom tags. For this you have to type the word and click "ENTER".
Problem:
When clicking enter the form gets submitted. Is there a way to prevent this ? Maybe a hook where I can control if something triggers the submit or not. Example:
onSubmitRequest={(requestedBy) => {
return requestedBy === 'submitButtonClick';
}}
Hi @TimoRuetten. There's no logic on what caused the submit - we just listen to onSubmit of the <form> element. To prevent this, you may use preventDefault at this very event.
Alright! Thats enough info. I already do this to prevent it. I was just thinking that maybe there is something build in. Thanks :)