RocketChat / RocketChat/Rocket.Chat

API - hiding the widget doesn't completely hide the html

Open
#18,108 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

I set up the livechat on my site and I deactivate it on a page containing a video. I disable the livechat because it blocks certain functions of my player and disturbs the playback.

I use this feature to hide the livechat:

RocketChat(function() {
    this.hideWidget();
});

The livechat is then hidden but there is still HTLM blocking a button that is located behind the livechat. Here is a screenshot of the HTLM that is not disabled:`
firefox_hg26jt2cMl

Here is the HTML code is blocking:

<div class="rocketchat-widget" style="position: fixed; width: 86px; height: 86px; max-height: 100vh; bottom: 0px; right: 0px; z-index: 12345; left: auto;" data-state="closed"><div class="rocketchat-container" style="width: 100%; height: 100%;"><iframe id="rocketchat-iframe" style="width: 100%; height: 100%; border: medium none; background-color: transparent; display: none;" src="https://chat.example/livechat"></iframe></div></div>
Steps to reproduce:
  1. Set-up the livechat on your website
  2. Use the function to hide the livechat wiget
  3. Try to click on a button which is behind
  4. You can't click on it because there's still some HTML present.
Expected behavior:

The HTML code would also have to be removed or the CSS style would have to be modified so that the size of the box no longer interferes.

Actual behavior:

You can't click behind even when the widget is hidden.

Server Setup Information:
  • Version of Rocket.Chat Server: 3.2.2
  • Operating System: Ubuntu 18.04
  • Deployment Method: snap
  • NodeJS Version: 8.15.1
  • MongoDB Version: 3.6.14
Additional context

I found this temporary solution that reduces the size to 1px:

document.getElementsByClassName("rocketchat-widget")[0].style.width = 1px;
document.getElementsByClassName("rocketchat-widget")[0].style.height = 1px;

I had opened a ticket on the repo "Rocket.Chat.Livechat" but I think you don't look at the tickets there, so I decided to open it here.

Ticket open: https://github.com/RocketChat/Rocket.Chat.Livechat/issues/356

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the RocketChat(function() { this.hideWidget(); }) API to the element with class rocketchat-widget and its inline dimensions. Reproduce the hidden-widget state and verify that the fixed widget no longer blocks clicks behind it; preserve the expected hidden behavior and add regression coverage if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.