# (BUG) Chatbox maximize() function bug

**URL:** <https://forum.wixstudio.com/t/bug-chatbox-maximize-function-bug/30743>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [January 5, 2020, 7:35pm UTC](https://forum.wixstudio.com/t/bug-chatbox-maximize-function-bug/30743 "2020-01-05T19:35:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shan](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/shan/32/106059_2.png) [@Shan](https://forum.wixstudio.com/u/Shan)\
**Post date:** [January 5, 2020, 7:35pm UTC](https://forum.wixstudio.com/t/bug-chatbox-maximize-function-bug/30743/1 "2020-01-05T19:35:39Z")

</div>

The [Wix Chatbox](https://www.wix.com/corvid/reference/$w.Chatbox.html)[.maximize()](https://www.wix.com/corvid/reference/$w.Chatbox.html#maximize) function is bugged on mobile devices.

As you can see that the Chatbox maximizes correctly on desktop but on mobile devices it does not. If you try to manually open the chatbox the window is bugged and the icon to close the chatbox does not appear in frame.

The relevant code on the page is given below the video.

[![](https://us1.discourse-cdn.com/wix/original/3X/e/a/ead144a71294ef8f15e4991d98109a4748d77962.jpeg "Wix Chat .maximize() Bug") ](https://www.youtube.com/watch?v=ciZT6MSV6GE)

```javascript
import wixLocation from 'wix-location';
import {session} from 'wix-storage';

$w.onReady(function () {
    initiateChat();
    let value = wixLocation.query["source"]
    if(value === 'form') {
      $w("#mainText").text = 'Message Received';
      $w("#mainText").show();
      $w("#supportTxt").show();
      $w("#image").show();
      $w("#loader").hide();
   } else if(value === 'payment') {
     $w("#mainText").text = 'Payment Successful';
     $w("#mainText").show();
     $w("#supportTxt").show();
     $w("#image").show();
     $w("#loader").hide();
   } else {
     $w("#mainText").text = 'Nothing to see here!';
     $w("#mainText").show();
     $w("#loader").hide();
   }
});

function initiateChat() {
   let project = session.getItem("project");
   if(project) {
     sendMsg(project);
   } else {
     console.log('None');
   }
}

function sendMsg(project) {
   let messageInfo = {
      "messageText": 'Dude Lemon Project Contact Form Submitted For ' + String(project)
   };
   $w("#wixChat1").sendMessage(messageInfo)
   .then( () => {
      max();
   })
   .catch((err) => {
      console.log(err);
   });
}

function max() {
   $w("#wixChat1").maximize()
   .then(() => {
      console.log("Done with maximize");
   })
   .catch( (err) => {
      console.log(err);
   });
}

```

---

<div class="post-metadata">

**Author:** ![givemeawhisky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/givemeawhisky/32/5383_2.png) [@givemeawhisky](https://forum.wixstudio.com/u/givemeawhisky)\
**Post date:** [January 5, 2020, 8:32pm UTC](https://forum.wixstudio.com/t/bug-chatbox-maximize-function-bug/30743/2 "2020-01-05T20:32:31Z")

</div>

Shan,

Have a read of the previous posts here as there was an issue with the Wix Chatbox Backend API and the maximize function that was being addressed in Dec 2019, so they may have fixed it for desktop only and not for mobile.

Are you able to test it on a tablet device to see if it works there too and see if it is just mobile that is affected?

[https://www.wix.com/corvid/forum/community-discussion/open-chat-widget-when-button-is-clicked](https://www.wix.com/corvid/forum/community-discussion/open-chat-widget-when-button-is-clicked)  
[https://www.wix.com/corvid/forum/community-discussion/how-to-access-wix-chat-chatbox-api-events](https://www.wix.com/corvid/forum/community-discussion/how-to-access-wix-chat-chatbox-api-events)

Both of them work if you test them on a live published site and not through the preview.

Adding @erez-paperny into this chat so that he can have a look at it for you. 🤞

---

<div class="post-metadata">

**Author:** ![lamateacherapp](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/lamateacherapp/32/17876_2.png) [@lamateacherapp](https://forum.wixstudio.com/u/lamateacherapp)\
**Post date:** [March 28, 2020, 3:35pm UTC](https://forum.wixstudio.com/t/bug-chatbox-maximize-function-bug/30743/3 "2020-03-28T15:35:05Z")

</div>

So now I have the same issue. I there anything new on this matter please?  
Thanks,  
Tom

---

<div class="post-metadata">

**Author:** ![puvi247x](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/puvi247x/32/18130_2.png) [@puvi247x](https://forum.wixstudio.com/u/puvi247x)\
**Post date:** [October 20, 2020, 4:26am UTC](https://forum.wixstudio.com/t/bug-chatbox-maximize-function-bug/30743/4 "2020-10-20T04:26:04Z")

</div>

Yup I’ve faced this problem before, gone through a few other discussions threads. Only managed to make it work on desktop. All the other threads, don’t address the mobile issue, it’s only solved for desktop.

On mobile it’s buggy, it doesn’t maximize the chatbox when the link button is clicked. And if I click on the chatbox directly after that, I am unable to close the chat window. I have to close the whole tab and then reopen the page.

Any update on this will be much appreciated. 😊
