OvidijusParsiunas / deep-chat

Fully customizable AI chatbot component for your website
https://deepchat.dev
MIT License
1.42k stars 214 forks source link

Display placeholder text when there is no text all the time #236

Open Wacil23 opened 1 month ago

Wacil23 commented 1 month ago

textInput doesn't provide an onBlur function in order to display a placeholder after blur on the input text... What would be good is to be able to do somethig like : inputText.onBlur : { styles: {....} placeholder: {...} }

OvidijusParsiunas commented 1 month ago

Hi @Wacil23. Is your intent to keep the placeholder after user click? If so, I can try to add functionality to have placeholder text at all times until there is some text present in the text input. Let me know if this would be helpful.

Wacil23 commented 1 month ago

Hey @OvidijusParsiunas , It would be very cool !

OvidijusParsiunas commented 1 month ago

Sounds good. I am currently on vacation and will be back home in a couple of days. I will start the work for this then. Thankyou!

OvidijusParsiunas commented 1 month ago

Hi @Wacil23.

I have explored this further and have decided that displaying the placeholder text when there is no text input should be the default behaviour. This is motivated by the observed chat behaviour in ChatGPT, Gemini, Slack and Facebook chats.

I have made the changes and published them in the deep-chat-dev and deep-chat-react-dev packages version 9.0.188. These packages behave the same as the main ones except their names are different. You can use these packages now and the code update will be added to the main packages on the next release. The date for the next release has not been decided yet but I will update the thread when I have any more news. Thanks!