-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add dispatch event to update style options #2383
Comments
Web Chat's conversation state is maintained in a Redux Store while the components state - things like the If you want to dynamically change the styles, you can wrap Web Chat in a React Component, store the Related to #2361 Hope this helps! |
Agree on @tdurnford, having a dispatch function that modify a prop is weird. The prop's content should be owned by the parent, unless it is named "initialStyleOptions". If you prefer dispatch, you can consider using a Redux store outside of Web Chat (ancestor of Web Chat), to control what |
@compulim @corinagum How do we approach this if we were rendering the webchat in an application that doesnt use React? We can pass the initial style options object as part of the renderWebChat call, but if we had to update the styles after the conversation has started, how should it be done? |
@tdurnford while your solution works, it has some flaws: When using adaptive - cards with input - fields, the user - inputs gets deleted in the moment when we update the styleOptions (In this case we update the styleOptions exactly in the moment when the adaptive - card was submitted): I guess this happens because the webchat gets re-rendered. |
Feature Request
Describe the suggestion or request in detail
If webchat is being rendered in a native javascript application, there seems to be no straightforward way to update style options after the webchat has been initialized. Adding a new dispatch event would make it easy - Something like 'WEB_CHAT\UPDATE_STYLE' with the new styleOptions object.
[Enhancement]
The text was updated successfully, but these errors were encountered: