From cf348e7dea92e178048c4306afd1b974e0858779 Mon Sep 17 00:00:00 2001 From: baegofda Date: Mon, 8 Jan 2024 14:35:08 +0900 Subject: [PATCH] (#0) npm publish (0.0.142) --- package.json | 2 +- src/core/components/Input/InputTextArea/index.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 2ddaa71..bcc5b97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bbodek-ui", - "version": "0.0.141", + "version": "0.0.142", "type": "module", "author": "Bbodek", "license": "MIT", diff --git a/src/core/components/Input/InputTextArea/index.tsx b/src/core/components/Input/InputTextArea/index.tsx index e7633b7..62cbc33 100644 --- a/src/core/components/Input/InputTextArea/index.tsx +++ b/src/core/components/Input/InputTextArea/index.tsx @@ -19,12 +19,12 @@ const InputTextArea = forwardRef(( ref: React.Ref, ) => { const id = useId(); - const { rootClassName, className, required, value, onChange, autoComplete = "off", maxLength, error, name, ...rest } = props; + const { rootClassName, className, required, value, onChange, autoComplete = "off", maxLength = 150, error, name, ...rest } = props; const { inputValue, onChangeHandler } = useInput({ value, regCallback, onChange, name }); - const currentInputValueLength = (inputValue as string).length; + const currentInputValueLength = (inputValue as string)?.length || 0; const onChangeTextArea = (e: React.ChangeEvent) => { - if(e.target.value.length > maxLength!) return; + if((e.target?.value ?? "").length > maxLength) return; onChangeHandler(e); };