Feat: Change Input to Textbox

This commit is contained in:
mickr777 2023-07-20 19:11:18 +10:00 committed by GitHub
parent 8d77c5ca96
commit f73b45bcb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import { Input } from '@chakra-ui/react';
import { Textarea } from '@chakra-ui/react';
import { useAppDispatch } from 'app/store/storeHooks';
import { fieldValueChanged } from 'features/nodes/store/nodesSlice';
import {
@ -12,10 +12,9 @@ const StringInputFieldComponent = (
props: FieldComponentProps<StringInputFieldValue, StringInputFieldTemplate>
) => {
const { nodeId, field } = props;
const dispatch = useAppDispatch();
const handleValueChanged = (e: ChangeEvent<HTMLInputElement>) => {
const handleValueChanged = (e: ChangeEvent<HTMLTextAreaElement>) => {
dispatch(
fieldValueChanged({
nodeId,
@ -25,7 +24,18 @@ const StringInputFieldComponent = (
);
};
return <Input onChange={handleValueChanged} value={field.value}></Input>;
return (
<Textarea
style={{
height: '200px',
width: '350px',
resize: 'none',
overflowY: 'auto',
}}
onChange={handleValueChanged}
value={field.value}
/>
);
};
export default memo(StringInputFieldComponent);