instantpage/instant.page

Problems with event.preventDefault() and links

Opened this issue · 8 comments

With the new update clicks on links which have a click listener which prevents opening the link are not working anymore. The link will open regardless of preventDefault.

Made an example here: https://codepen.io/maysi/pen/b492d4c51109a85c8cb5fbd9a41f083b

The new "shortcut" basically triggers a click event on mousedown
I also got issue with my dropdowns opening on mousedown and closing on mouseup

Yes, the new version have big problem.

it cause the fancybox not work..
when click the image, it will run the fancybox and show the widget.
but now it will open the another tab and show the photo.

also, it cause my another button not work.
it will call twice when i click the button.

i have change the script back to old version.

This release also breaks two classical UX patterns:

  • Drag-and-dropping: you can start dragging a link and drop it into a new tab or onto an existing tab
  • Cancellation: you can start clicking a link or a button (by pressing the mouse button down) – but then change your mind, move the pointer away, and release the mouse button

It breaks some stuff for me also.
Tabs from Foundation: https://get.foundation/sites/docs/tabs.html
It also breaks jQueryUI Datepicker (changing months with arrows): https://jqueryui.com/datepicker/

Had to use data-instant-no-mousedown-shortcut on body everywhere.

  • Cancellation: you can start clicking a link or a button (by pressing the mouse button down) – but then change your mind, move the pointer away, and release the mouse button

That was my main issue at first also.

I opened a issue with drop downs automatically closing when you click on them #71

WordPress plugin is unreliable at the moment and not safe to use in production.

Pretty sure this can be fixed by setting cancelable: true. PR incoming.

Hi ... is this issue fixed ?

Hi ... is this issue fixed ?

Yes, it's fixed in 6d41fe5