BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

How to use useScrollTo with ReactWebChat for a react based chat application

Open swarnava112 opened this issue 2 years ago • 2 comments

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 avatar Jan 25 '24 14:01 swarnava112

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.

swarnava112 avatar Feb 05 '24 10:02 swarnava112

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

stevkan avatar Feb 16 '24 02:02 stevkan

Closing due to inactivity.

stevkan avatar Apr 18 '24 22:04 stevkan