Cannot read property 'getSelection' of undefined when unmounting React component
maksimovicdanijel opened this issue · 1 comments
Hi,
first of all great little library! Congrats. We are trying to create a React component that will serve as a wrapper around share-this
library. We have an issue when unmounting that component. It says
Cannot read property 'getSelection' of undefined
Here is the codesandbox that you can take a look https://codesandbox.io/s/0pl29v3p5l
Steps to reproduce:
- Select a text
- Clear selection by clicking outside of the text
- Click on toggle button
Expected results
- No error is thrown
All right, first of all: sorry if I'm super-late, but I really had to wait for the holidays to look into it! 😕
And second, I currently have a very crappy connection! 😫
Anyway, at a first glance it's not just a React thing, it's more like a general bug caused by the workaround for Safari's selectionchange
bug. I'll look into it soon, I might have a solution on hand.
Thank you for reporting this, and happy holidays!