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 use useScrollTo with ReactWebChat for a react based chat application #5007

Closed
swarnava112 opened this issue Jan 25, 2024 · 3 comments
Closed
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Required for internal Azure reporting. Do not delete. question Further information is requested. Stack Overflow candidate

Comments

@swarnava112
Copy link

I have a question

I have a chat application, in which we render the chat using ReactWebChat . Now I want that, when a message comes from the bot, we scroll to top of that message and not to end like the default behaviour.

I want to use the useScrollTo hook for this purpose, but I am getting error that says :-

This hook can only be used inside the descendent of a <Composer>

How can I use the useScrollTo hook along with ReactWebChat to achieve the required behaviour?

@swarnava112 swarnava112 added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Required for internal Azure reporting. Do not delete. question Further information is requested. Stack Overflow candidate labels Jan 25, 2024
@swarnava112
Copy link
Author

I was able to do it in a different manner.

I was setting StyleOptions when using ReactWebChat . I wanted to prevent the default scroll to bottom, hence I used the autoScrollSnapOnPage and autoScrollSnapOnPageOffset.

Please advise if this is a correct approach.

@stevkan stevkan self-assigned this Feb 16, 2024
@stevkan
Copy link
Contributor

stevkan commented Feb 16, 2024

@swarnava112 - Are you still have an issue with this?

@stevkan
Copy link
Contributor

stevkan commented Apr 18, 2024

Closing due to inactivity.

@dmvtech dmvtech closed this as completed Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Required for internal Azure reporting. Do not delete. question Further information is requested. Stack Overflow candidate
Projects
None yet
Development

No branches or pull requests

3 participants