Yeldaai / chat-plugin

Yelda Chat Plugin
MIT License
0 stars 0 forks source link

BUG: Can't open the webchat on Best Western on mobile #124

Closed codebynao closed 1 year ago

codebynao commented 2 years ago

Describe the bug Error in console: TypeError: this.removeElement is not a function. (In 'this.removeElement("yelda_assistant_bubble_text")', 'this.removeElement' is undefined)

To Reproduce Steps to reproduce the behavior:

  1. On mobile, go to https://www.bestwestern.fr/
  2. Wait for the chat bubble to appear on the right corner
  3. Clic on the bubble then on "Discuter avec l'assistant vocal"
  4. Nothing happens. The error above appears in the console

Expected behavior A clear and concise description of what you expected to happen.

Environment It happens on both iOS and Android so it does not seem to be browser/os related

meelie commented 2 years ago

client code is

yeldaChat.init({settingId: '600e9e10b546c5102ceed404' }) ;
var elementToClick = document.getElementById('voice-bot') ;
elementToClick.addEventListener('click', yeldaChat.openChat) ;

We need to bind the yeldaChat

yeldaChat.init({settingId: '600e9e10b546c5102ceed404' }) ;
var elementToClick = document.getElementById('voice-bot') ;
elementToClick.addEventListener('click', yeldaChat.openChat.bind(yeldaChat)) ;

it fix the JS error

but there is maybe a css issue to investigate : yelda_container is in wrapperOptions html element, and i see yelda_container force to 0, 0

Selection_953

thomasgx commented 1 year ago

I don't know if the issue is related, but the client is now mentionning the problem. I can see a JS error on the website, in mobile mode :

image

We need to fix it at the earliest now.

codebynao commented 1 year ago

JS issue and CSS fixed on the client side with

yeldaChat.init({settingId: '600e9e10b546c5102ceed404' });
var elementToClick = document.getElementById('voice-bot');
// Ancien code: elementToClick.addEventListener('click', yeldaChat.openChat);
// Fix:
elementToClick.addEventListener('click', yeldaChat.openChat.bind(yeldaChat)); 
// In on_s_engage.jsp on the client side
.yelda_container #yelda_assistant_bubble_text, .yelda_container #yelda_iframe_container {
 visibility: hidden !important; // <= removed
 font-size: 0;
}