Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to share any value in input directly #264

Open
habibunnish opened this issue Nov 11, 2024 · 8 comments
Open

how to share any value in input directly #264

habibunnish opened this issue Nov 11, 2024 · 8 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@habibunnish
Copy link

Bug Description:
I could not able to share any word directly to chatbot input

Steps To Reproduce:

Expected behavior:
when i click potentialquestions word any it should copy that selectedword and get paste in chatbot input field

I have aadded below file to check in local
index.zip

Library version:
Specify the version of the library (e.g. 1.7.0).

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser: [e.g. chrome, safari]

Mobile (please complete the following information):

  • Device: [e.g. iPhone12]
  • OS: [e.g. iOS8.1]
  • Browser: [e.g. edge, firefox]

Additional context:
Add any other context about the problem here (e.g. plugins used, if any).

@habibunnish habibunnish added the bug Something isn't working label Nov 11, 2024
@tjtanjin
Copy link
Owner

Hey @habibunnish! This is actually not a bug - you're passing userInput as a prop into ChatBot but ChatBot doesn't accept such a prop. You can refer to its documentation here for the props accepted: https://react-chatbotify.com/docs/api/chatbot

Moving on to your use case, if you're looking to modify chatbot input externally, you'll want to use hooks: https://react-chatbotify.com/docs/api/hooks#usetextarea

@tjtanjin tjtanjin added help wanted Extra attention is needed and removed bug Something isn't working labels Nov 11, 2024
@habibunnish
Copy link
Author

ok let me check it

@habibunnish
Copy link
Author

index.zip
i have tried but its not working can u plz tell me what wrong am i doing here

@tjtanjin
Copy link
Owner

Hey @habibunnish, you're passing a ref into the chatbot and trying to call setTextAreaValue on it but that's not how it works. You should be leveraging hooks, specifically the useTextArea hook which I've also linked earlier: https://react-chatbotify.com/docs/api/hooks#usetextarea

If you need some examples on how hooks can be used, you may look over here: https://react-chatbotify.com/docs/examples/custom_hooks

@habibunnish
Copy link
Author

ok let me check it

@habibunnish
Copy link
Author

Hi @tjtanjin

i have used this useTextArea hook and tried but its not showing that text in input field whenever i click potential questions words can u plz tell me where iam making mistake how to solve this

file1.txt
file2.txt

@tjtanjin
Copy link
Owner

tjtanjin commented Dec 4, 2024

Hi @tjtanjin

i have used this useTextArea hook and tried but its not showing that text in input field whenever i click potential questions words can u plz tell me where iam making mistake how to solve this

file1.txt file2.txt

Hey @habibunnish, if you're using hooks, you need to use ChatBotProvider. Strongly recommend to read through the entire hooks documentation in detail before using it: https://react-chatbotify.com/docs/api/hooks/#overview

@habibunnish
Copy link
Author

oh ok let me try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants