OvidijusParsiunas / deep-chat

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

text input placeholder to be there after question's answer received or question sent #210

Open abhinavverma-sf opened 3 weeks ago

abhinavverma-sf commented 3 weeks ago

Hi

As per demo available here https://deepchat.dev/docs/styles/#generic-example I can see after first question I am not able to get the placeholder back.

Can anybody help me on how to go about it?

OvidijusParsiunas commented 2 weeks ago

Hi @abhinavverma-sf.

I have added a new method to the Deep Chat component called setPlaceholderText. This method is going to be used to dynamically set and change the input placeholder text.

To note, this method will not change the input text if the user has focused the input or has already typed something there as otherwise it would lead to bad UX.

The method type is:

(text: string) => void

The method can be used as follows:

deepChatEl.setPlaceholderText('New text');

This method is currently available in deep-chat-dev and deep-chat-react-dev packages version 9.0.178. These packages behave the same way as the core ones except their names are different. To note, we are preparing for a big release, so some properties are called differently - e.g. request is called connect etc. Nevertheless, all of the old properties should work just fine - but you might get TS/console warnings which you can ignore.

Let me know if this help you.

abhinavverma-sf commented 2 weeks ago

@OvidijusParsiunas thanks. So it is not available in release 1.4.11 of deep-chat, and would be available next in the big release. Alright