From ab4ed8c78681e0bda514bf6343d54914841a0e72 Mon Sep 17 00:00:00 2001 From: Sudara Date: Thu, 6 Jun 2019 22:06:14 +0200 Subject: Ensure non-mouse/programmatic clicks work with data-remote --- actionview/app/assets/javascripts/rails-ujs/features/remote.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionview/app') diff --git a/actionview/app/assets/javascripts/rails-ujs/features/remote.coffee b/actionview/app/assets/javascripts/rails-ujs/features/remote.coffee index a5b61220bb..d1aeef56c7 100644 --- a/actionview/app/assets/javascripts/rails-ujs/features/remote.coffee +++ b/actionview/app/assets/javascripts/rails-ujs/features/remote.coffee @@ -88,6 +88,6 @@ Rails.preventInsignificantClick = (e) -> data = link.getAttribute('data-params') metaClick = e.metaKey or e.ctrlKey insignificantMetaClick = metaClick and method is 'GET' and not data - primaryMouseKey = e.button is 0 - e.stopImmediatePropagation() if not primaryMouseKey or insignificantMetaClick + nonPrimaryMouseClick = e.button? and e.button isnt 0 + e.stopImmediatePropagation() if nonPrimaryMouseClick or insignificantMetaClick -- cgit v1.2.3