diff --git a/src/components/ChatBotInput/ChatBotInput.tsx b/src/components/ChatBotInput/ChatBotInput.tsx index a9af7aaa..bd8ee5fa 100644 --- a/src/components/ChatBotInput/ChatBotInput.tsx +++ b/src/components/ChatBotInput/ChatBotInput.tsx @@ -125,7 +125,7 @@ const ChatBotInput = ({ if (inputRef.current) { const characterLimit = botOptions.chatInput?.characterLimit const newInput = event.target.value.replace(/\n/g, " "); - if (characterLimit != null && characterLimit > 0 && newInput.length > characterLimit) { + if (characterLimit != null && characterLimit >= 0 && newInput.length > characterLimit) { inputRef.current.value = newInput.slice(0, characterLimit); } else { inputRef.current.value = newInput diff --git a/src/services/BotOptionsService.tsx b/src/services/BotOptionsService.tsx index c70bdbd3..4f0f8e5a 100644 --- a/src/services/BotOptionsService.tsx +++ b/src/services/BotOptionsService.tsx @@ -79,8 +79,8 @@ const defaultOptions = { disabled: false, enabledPlaceholderText: "Type your message...", disabledPlaceholderText: "", - showCharacterCount: true, - characterLimit: 10, + showCharacterCount: false, + characterLimit: -1, botDelay: 1000, sendButtonIcon: sendButtonIcon, blockSpam: true, diff --git a/src/services/VoiceService.tsx b/src/services/VoiceService.tsx index 99291beb..e3f23722 100644 --- a/src/services/VoiceService.tsx +++ b/src/services/VoiceService.tsx @@ -45,7 +45,7 @@ export const startVoiceRecording = (botOptions: Options, handleToggleVoice: () = if (inputRef.current) { const characterLimit = botOptions.chatInput?.characterLimit const newInput = inputRef.current.value + voiceInput; - if (characterLimit != null && characterLimit > 0 && newInput.length > characterLimit) { + if (characterLimit != null && characterLimit >= 0 && newInput.length > characterLimit) { inputRef.current.value = newInput.slice(0, characterLimit); } else { inputRef.current.value = newInput