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

Widget is not opening when corner button is clicked #316

Open
ifis98 opened this issue Feb 7, 2023 · 10 comments
Open

Widget is not opening when corner button is clicked #316

ifis98 opened this issue Feb 7, 2023 · 10 comments

Comments

@ifis98
Copy link

ifis98 commented Feb 7, 2023

Clicking the widget is not opening the chat. What may be wrong? I used the same format as the documentation to add the widget.

@nb-programmer
Copy link

nb-programmer commented Mar 3, 2023

I had the same issue. It was probably due to React version being too new, as this package needs ^17.0.2 (currently it is 18). I downgraded React by following this https://stackoverflow.com/a/71908461 and now it seems to work when I click. Not sure exactly why though. Also this seems to be the same issue as #310

@logone72
Copy link

I had same issue aswell and solution by @nb-programmer solved it.

@Aiyaz17
Copy link

Aiyaz17 commented Sep 22, 2023

But what if we can't downgrade to react 17, what can we do in that case, or is there any other alternative lib for this?

@tinspham209
Copy link

you can control it manually like this. It's work for me in React 18.2

  import { React, useEffect, useState } from "react";
  const [chatWindowOpen, setChatWindowOpen] = useState(true);

  const handleToggle = (open) => {
    setChatWindowOpen((prev) => !prev);
  };

  <Widget
    handleToggle={handleToggle}
  />

@Janki-T
Copy link

Janki-T commented Feb 9, 2024

Your solution is worked thank you @tinspham209

@HtetWaiYan7191
Copy link

Thank you so much for your solution @tinspham209 .

@HtetWaiYan7191
Copy link

Is there any other alternative third party library for this. This seems a little bit outdated . Thank you guys .

@lexNwimue
Copy link

Can I set the chat widget open as the default behaviour? I want it always open.

@kitare17
Copy link

you can control it manually like this. It's work for me in React 18.2

  import { React, useEffect, useState } from "react";
  const [chatWindowOpen, setChatWindowOpen] = useState(true);

  const handleToggle = (open) => {
    setChatWindowOpen((prev) => !prev);
  };

  <Widget
    handleToggle={handleToggle}
  />

Thank you so much <3

@mrwilbroad
Copy link

you can control it manually like this. It's work for me in React 18.2

  import { React, useEffect, useState } from "react";
  const [chatWindowOpen, setChatWindowOpen] = useState(true);

  const handleToggle = (open) => {
    setChatWindowOpen((prev) => !prev);
  };

  <Widget
    handleToggle={handleToggle}
  />

this solution help me , great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants