react-component / react-component/slider

Illegal invocation of RAF when tooltip is applied to a slider that is not visible when initially rendered

Open
#732 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.1k
Forks
768
Avg merge
11d 22h
Merged PRs (30d)
5

Description

We noticed this in our app when we put a tooltipped slider inside a popover, the app would crash when the popover was opened and the console would have an error throwing "Illegal invocation" on the raf.cancel call here: https://github.com/react-component/slider/blob/master/src/common/SliderTooltip.tsx#L15

This is caused by rc-util not binding its wrapped version of requestAnimationFrame to the window object. This is fixed in a newer version of rc-util. As a workaround we have pinned the version of rc-util used by rc-slider to ^5.5.1 via yarn's resolutions feature, but it should probably get version-bumped here as well.

Contributor guide

No contributing guide indexed for this repository

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 with src/common/SliderTooltip.tsx at the raf.cancel call linked in the issue, then inspect rc-slider's rc-util dependency declaration. Update rc-util to a version containing the requestAnimationFrame binding fix and verify that a tooltipped slider rendered hidden in a popover no longer throws when the popover opens.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.