jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.42k stars 714 forks source link

iPhone can´t delete modules #801

Open JTorresConsulta opened 6 months ago

JTorresConsulta commented 6 months ago

Opening the demo in my iPhone: https://jerosoler.github.io/Drawflow/

When I try to remove module holding down the screen, the module text is selected but not the delete option appear.

Thanks, congratulations for the good job :)

JTorresConsulta commented 6 months ago

This video show it

https://github.com/jerosoler/Drawflow/assets/22349981/4dcc2c52-b3fe-4f57-b74d-72b56c18bd72

jerosoler commented 6 months ago

Hi! @JTorresConsulta

In this case we use the "user-select" property. It seems that iPads and iPhones do not detect it correctly.

I don't have an iPhone to test, but it could be that disabling the "touch-action" property works.

https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action

If you haven't found this issue on stackoverflow: https://stackoverflow.com/questions/16613503/webkit-user-select-none-not-working

That's also a demo! Of some library functionalities.

jerosoler commented 6 months ago

More info: https://www.designcise.com/web/tutorial/how-to-fix-issues-with-css-user-select-none-not-working

JTorresConsulta commented 6 months ago

Hi @jerosoler !

Yes I tried disabling the touch and selection but iPhone navigators do not recognize the "right" click of mouse, then the X symbol to delete nodes not appear :(

What is the function where this is triggering? Is possible to trigger with double click event too?

Thanks !! :))

jerosoler commented 6 months ago

Try add event dobleclick:

    editor.container.addEventListener('dblclick',(e) =>  {
        if(editor.node_selected !== null) {
            editor.contextmenu(e);
        }
    });