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

Context popup menu far from the mouse #17

Open dandv opened 9 years ago

dandv commented 9 years ago

When you select downward text that comprises multiple lines, the Y coordinate of the context menu is at the beginning of the selection. The X is correct.

@molily's component doesn't suffer from this problem (demo).

context popup menu far from the mouse

dandv commented 9 years ago

Fixed in my fork of SelectionMenu that addresses a few other issues from selection-sharer and makes it general (i.e you can put anything you want in the menu).

xdamman commented 9 years ago

@dandv can you submit a pull request so that everybody can benefit from it? Thanks!

dandv commented 9 years ago

@xdamman: in the meantime our fork evolved quite radically by using HubSpot's Drop library (which prevents #20 in selection-sharer).

Perhaps it's best we continue efforts in that direction?

q2apro commented 7 years ago

I think it is smarter to show the menu directly where the mouse was released.

Change line 148

var top = topOffset + self.getPosition().y - self.$popover.height();

to:

var top = e.pageY - self.$popover.height() - 10;