xdamman / selection-sharer

Medium like popover menu to share on Twitter or by email any text selected on the page
MIT License
510 stars 104 forks source link

Sharer not closing when losing focus #27

Open reneroth opened 9 years ago

reneroth commented 9 years ago

The sharer only closes if you click on a targeted element, not if the selection loses focus by clicking on an element that is not targeted by selection-sharer.

As a fix, I use:

if(!window.getSelection().length) {
    self.hide();
    return;
}

in this.selectionChanged, line 311, before checking self.isMobile.

Ecnelis commented 7 years ago

This fix doesn't seem to work anymore. Is there any onther way to fix it?