EmbeddedChat icon indicating copy to clipboard operation
EmbeddedChat copied to clipboard

Close Button issue in ChatHeader

Open umangutkarsh opened this issue 2 years ago • 9 comments

Description:

Clicking the close button in ChatHeader does nothing and an error is generate in the console when the button is clicked.

Steps to reproduce:

  1. Open Storybook
  2. Enable the isClosable prop from the addon section if not done
  3. Open the console
  4. Click on the close button and see error.

Expected behavior:

The setClosableState should be a function if passed in the onClick prop of the Close button

Actual behavior:

isClosable.webm

umangutkarsh avatar Jan 14 '24 18:01 umangutkarsh

Maintainers, please let me know if this needs attention and if yes then what should be done when close button is clicked. Thanks.

umangutkarsh avatar Jan 14 '24 18:01 umangutkarsh

Hey @umangutkarsh, can you give me an idea what does this setClosableState do??

devanshkansagra avatar Jan 16 '24 09:01 devanshkansagra

Hey @umangutkarsh, can you give me an idea what does this setClosableState do??

Hi @devanshkansagra . Imo, it should either be a function or a Boolean

umangutkarsh avatar Jan 16 '24 09:01 umangutkarsh

Hey @umangutkarsh, I mean What operation it does. Does it close the session, or set the window to full screen or what??

And Ya it might be a function, coz it seems to do some operation

devanshkansagra avatar Jan 16 '24 09:01 devanshkansagra

I think setClosableState is a function passed from outside when EmbeddedChat is used in any website. It makes sense to pass a function from outside, since handling internally will be vague. Because if we close EmbeddedChat on clicking 'X' in development mode, we won't be able to open it without refresh. Please correct me for any misunderstandings @abhinavkrin

We can pass a No-operation function to handle it. setClosableState: () => {}

  • Hence clicking on 'X', the effect will only be seen in production once we pass a valid function.
  • So no errors during development.

Kamlesh72 avatar Jan 27 '24 04:01 Kamlesh72

Can anyone can help to setup the local environment because I am getting error related to EmbeddedChat API after running yarn storybook @umangutkarsh

yuvrajgohil24 avatar Feb 17 '24 19:02 yuvrajgohil24

Can anyone can help to setup the local environment because I am getting error related to EmbeddedChat API after running yarn storybook @umangutkarsh

What steps are you following?? Also could you share what issues you are getting?

umangutkarsh avatar Feb 17 '24 20:02 umangutkarsh

After running these commands :

cd packages/react yarn storybook This error occured. open-source

open-source1

I hope you can understand my issue after seeing the above screenshots @umangutkarsh

yuvrajgohil24 avatar Feb 18 '24 20:02 yuvrajgohil24

After running these commands :

cd packages/react yarn storybook This error occured. open-source

open-source1

I hope you can understand my issue after seeing the above screenshots @umangutkarsh

Seems to me you are not using WSL. Use wsl to run the dev env. Running the dev env, won't work on normal windows. If you face any other issues. Let me know

umangutkarsh avatar Feb 19 '24 18:02 umangutkarsh