APIs & Integrations

MOrtizGalan
Member

Bug. Chat opened programatically steal focus of input forms on mobile.

Hi all.

I´ve been experience a problem with the implementation of the chat in my web.

I dont implement the chat, i only control when to show and open it automatically. 

You can reproduce the error with this steps:

- Put the web (chrome in my case) in mobile format with developer options.

- Open: https://saludybienestar.segurcaixaadeslas.es/centro-ayuda/atencion-cliente/contacto?chatbot=general&...

- Accept cookies and reload page

- Chose any value in the select to show de form

- Go to console and open the chat with the command "HubSpotConversations.widget.open()"

- Minimize the chat

- Try to write in any input of the form

 

It looks like the focus try to go back to the chat or somethink like that. If you open and close the chat again dont happen again. Is there any way to avoid this behaviour programatically?

 

Thank you very much for your help.

2 Replies 2
JPan
Member

Bug. Chat opened programatically steal focus of input forms on mobile.

I entercourted same problem recently. Any suggestion of fixing this bug? It's very annoying in login page. When user reaches in login page and types username or password. After the widget is loaded, it steals the focus from input in login form.

0 Upvotes
RLeo
Contributor | Diamond Partner
Contributor | Diamond Partner

Bug. Chat opened programatically steal focus of input forms on mobile.

Hi @JPan the only temporary solution i've found is to use an Observer with Javascript, since there is no method available to know when the widget is opened or closed. With the observer you watch for an element class change and when it changes ( when chat is closed), remove the focus of any active elements in the DOM. 

The problem seems to be a "focusout" event added to the chat button, when this event is removed then it works fine. Problem is, you can't just remove a previously added event because you need the signature.

Definitely a bug that Hubspot should look at.

0 Upvotes