RocketChat / RocketChat/Rocket.Chat

Fix usage of "any" in a LiveChat component

Open Beginner friendly
#39,128 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description:

Menu in livechat currently declares ref?: any and PopoverMenuWrapper relies on a legacy component-instance shape (Component & { base: Element }). This bypasses strict typing and can hide ref mismatches between Menu and its consumers.

Expected behavior:

  • Menu should type ref from the actual rendered element contract (HTMLDivElement) instead of any.
  • PopoverMenuWrapper should store/use a DOM ref (HTMLDivElement | null) and call getBoundingClientRect() directly without .base.
Actual behavior:
  • MenuProps uses ref?: any.
  • PopoverMenuWrapper uses menuRef?.base?.getBoundingClientRect(), coupling to a legacy component ref shape and weakening type safety.

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

Search the LiveChat code for the Menu and PopoverMenuWrapper components, then inspect how Menu is rendered and how its ref is consumed. Update the ref types to match the HTMLDivElement contract and confirm that the wrapper uses the DOM element directly for getBoundingClientRect(); run the relevant TypeScript checks or frontend tests if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.