Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Duplicate player window #1470

Open
1 task done
fidelis27 opened this issue May 6, 2024 · 0 comments
Open
1 task done

[Bug]: Duplicate player window #1470

fidelis27 opened this issue May 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fidelis27
Copy link

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb-player

Version

1.0.0-alpha.4

Expected Behavior

I expect only one player to be rendered when opening a modal in react

Actual Behavior

When opening the modal and closing it several times, the player duplicates itself

Steps to Reproduce

` useEffect(() => {
const times: number[] = []

window.replayer = new rrwebPlayer({
  target: playerRoot.current,
  props: {
    events: dataRecording.events,
    tags: {
      width: String(metadata.width),
      height: String(metadata.height),
    },
    width: device === deviceType.MOBILE ? 297 : 724,
    height: device === deviceType.MOBILE ? 380 : 392,
  },
})

docs.forEach((doc: { timestamp: number }) => {
  times.push(doc.timestamp)
})

}, [dataRecording])`

Testcase Gist URL

No response

Additional Information

I believe that Windows, being global, makes the reaction confusing and creating the player again.

@fidelis27 fidelis27 added the bug Something isn't working label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant