dmitrizzle/chat-bubble

Bubbles reply issues

Closed this issue · 6 comments

Bug or feature request?

Let me know what type of issue this is.
When I click between the bubbles (somewhere at the top space between the two bubbles, then all bubbles disappears and chatbot can't move forward.

If it's a bug, please provide the full method to reproduce.

How did you end up seeing the bug? What steps did you take to see it?

Please see the image below, you can test it yourself
Capture

Hmm that's odd. Do you see any errors in browser console?

Hi Dmitrizzle/Chat-Bubble,

I did not see anything in the console when the bubbles disappear.

with kind regards,
Tahir

Same issue here.

The issue seems to be this function that's evoked once the user clicks the container .bubble. This function cleans up all the answer bubbles. It is meant to be fired at the same time as the onclick event of the actual bubble spans (constructed here).

So essentially, there are two different function called, one when the user click the bubble, and one when the user clicks the container span for the bubble. Normally, this happens at the same time, as the event propagate down the DOM tree. However, when you click in the area show in the screenshot above, you are only calling one of those functions, the one attached to the container.

The solution is to refactor this logic to have the containers' function called on the answer bubbles and not have to rely on even propagation.

I currently don't have bandwidth to make this change but I am open to PRs.

Fixed the issue by checking if the user clicked on a button or not. Created a pull request too.