ctxmenu icon indicating copy to clipboard operation
ctxmenu copied to clipboard

fix support for longPress in Safari (mobile)

Open MaxBittker opened this issue 1 year ago • 8 comments

I am attaching a menu to all the images on my page using an img selector, and I want to access the specific item in the action handler or in onBeforeShow. is there any built in facility for handling this in the library? apologies if I've missed it

MaxBittker avatar Jun 06 '24 20:06 MaxBittker

it's the second argument to onBeforeShow

MaxBittker avatar Jun 06 '24 22:06 MaxBittker

Actually, thanks for opening this! It's a good reminder to improve the documentation.

The latest update was a quick addition of more lifecycle events, which were originally planned for the next major release and I hastily put up some documentation.

I'll reopen this issue, so I won't forget it. 😊

nkappler avatar Jun 06 '24 23:06 nkappler

the library is great, I've used many variations on this theme (radix, etc) and will use this one again in the future

MaxBittker avatar Jun 06 '24 23:06 MaxBittker

do you have any advice on ios safari long press? it doesn't seem to work on my ios device

MaxBittker avatar Jun 06 '24 23:06 MaxBittker

I've noticed this, too.

I think apple intentionally dropped support for the contextmenu event for usability reasons.

I'm not sure why, since it is still a common thing, at least outside of the web.

I probably will have to write some sort of polyfill for this, but I haven't looked into it in detail, so unfortunately I don't have a solution for it yet.

nkappler avatar Jun 07 '24 16:06 nkappler

I probably will have to write some sort of polyfill for this, but I haven't looked into it in detail, so unfortunately I don't have a solution for it yet.

Is this a possible fix?

smalos avatar Feb 06 '25 23:02 smalos

yes, that looks like it should work. Do you want to write a PR?

nkappler avatar Feb 07 '25 08:02 nkappler

Unfortunately, I don’t own an iPhone or a Mac to test this, so I’m unable to assist with a PR.

smalos avatar Feb 10 '25 07:02 smalos