Widget randomly open without background

When app is open for a while (could be a few seconds or a few minutes) it suddenly pops up unsolicited sans the background. Please see screenshots:

Screenshot 2024-11-22 101511
Screenshot 2024-11-22 103139

My initiation code:

  try {
    const TAWK_API_KEY = process.env.REACT_APP_TAWK_API_KEY;

    window.Tawk_API = window.Tawk_API || {};
    window.Tawk_LoadStart = new Date();

    if (user?.email && TAWK_API_KEY) {
      const visitorHash = await generateTawkHash(user.email, TAWK_API_KEY);
      window.Tawk_API.visitor = {
        name: `${user.firstName} ${user.lastName}`,
        email: user.email,
        hash: visitorHash
      }
    }

    if (!document.getElementById('tawk-script') && 
        process.env.REACT_APP_TAWK_PROPERTY_ID && 
        process.env.REACT_APP_TAWK_WIDGET_ID) {
      (function() {
        var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
        s1.async=true;
        s1.src=`https://embed.tawk.to/${process.env.REACT_APP_TAWK_PROPERTY_ID}/${process.env.REACT_APP_TAWK_WIDGET_ID}`;
        s1.charset='UTF-8';
        s1.setAttribute('crossorigin','*');
        s0.parentNode.insertBefore(s1,s0);
      })();
    }
  } catch (error) {
    console.warn('Tawk setup failed:', error);
  }

Hi @roaringlion, thanks for reaching out.

This is the default “Welcome Message” Trigger.

You can disable it or edit it in Admin > Settings > Triggers.

1 Like

Thank you @kristaps
Found it and disabled. Not sure this should be the default, as I for one found it confusing.

Regarding missing background I see the same issue in the Help Center of Tawk itself
Screenshot 2024-11-25 161828
Pretty sure that’s a bug

@roaringlion, you can choose whether to maximize the widget or show the preview in Admin > Channels > Chat Widget. By default, it’s set to show the preview.

  • Desktop: When Disable Message Preview on Desktop is toggled on, the widget will maximize upon sending a message, instead of displaying the preview bubble.
  • Mobile: When Disable Message Preview on Mobile is toggled on, the widget will remain minimized and display a “(1)” notification.

1 Like