Hi. I’m using react-hook-form and react-tag-input-component. I’m trying to prevent form…
Jump to turn (10)
- 1Hi. I’m using react-hook-form and react-tag-input-component. I’m trying to preve
- 2Uncaught TypeError: inputEl.preventDefault is not a function
- 3this is my code that I've provided to you and said that is doesn't work
- 4Yes, the form is still submitting on pressing Enter. But I don't want that
- 5still does not work
- 6I think this component does not have keyDown prop. maybe we could somehow simula
- 7there's no such prop inputField
- 8this component does not have inputProps prop
- 9handleKeyDown event is not being triggered
- 10TagsInput does not have inputField prop
- User
Hi. I’m using react-hook-form and react-tag-input-component. I’m trying to prevent form submission on hitting ‘enter’ button. This is my code, I’m trying to use e.preventDefault() but it’s not working… could you help? import * as React from ‘react’; import * as i from ‘types’;
import { TagsInput } from ‘react-tag-input-component’; import { FormField } from ‘common/form’; import { Container } from ‘./styled’;
const formatValue = (value: string[] | string | undefined) => { if (Array.isArray(value)) { return value; }
if (value) { return value.split(', '); }
return []; };
export const TagInput: React.FC = ({ value, onChange, placeholder, name, label, description, error, }) => { const formFieldProps = { name, label, error, description };