Gesturefy icon indicating copy to clipboard operation
Gesturefy copied to clipboard

Gestures don't work on disabled input elements

Open KES777 opened this issue 8 years ago • 9 comments

Here you can see that I complete the action, release the button but action did not occur.

screenshot from 2017-12-05 11-41-57

I release the left mouse button (I am on linux FF v57) over up arrow

The action occur when current page lost the focus.

Please review this case

KES777 avatar Dec 05 '17 09:12 KES777

Thanks for the report (next time please include the url in your post)

Unfortunately it looks like I'm not able to fix this due to the following reason:

A click event on a disabled form field does not fire events in Firefox and Safari. Opera fires the mousedown and mouseup events, but not the click event. IE fires mousedown and mouseup, but not click, on the form. All these implementations are considered correct. (source: https://www.quirksmode.org/dom/events/click.html)

Here is a little example where you can test this behaviour: https://codepen.io/anon/pen/vWMNjV In Chrome you will receive the cursor position by clicking on any of the 3 input fields. In Firefox you won't receive the position when you click on the first one. The only possible fix would be to apply "pointer-events: none" to every disabled element, but this may have some undersired side effects. Maybe I can apply the "pointer-events: none" property to the whole document exluding my overlay (I'll try this later)

Robbendebiene avatar Dec 05 '17 12:12 Robbendebiene

the url is visible on screenshot. here is it: https://habrahabr.ru/company/mailru/blog/343288/

KES777 avatar Dec 05 '17 14:12 KES777

@KES777 I know, otherwise I wouldn't be able to reproduce your problem. The point I tried to make was, that it took time to typewrite every single letter, whereas copy and pasting the url here would have taken you two seconds.

Robbendebiene avatar Dec 05 '17 15:12 Robbendebiene

So while adding pointer-events: none temporary to the body might fix the problem on some pages, it won't work for nested iframes which contain disabled html elements. Besides that, this would only fix the removal of the gesture trail but it would still be impossible to start a gesture over a disabled element.

To sum things up: There is no good universal solution (the only possible solution may break websites, which can lead to unforeseen consequences). I guess this is the first time I wish Firefox would behave like chrome..

Since disabled elements are quite seldom and normally not page filling this bug shouldn't be so harmful. (Btw. choosing the right mouse button (requires Firefox 58b7 on Linux/MacOS) would fix your particular problem, but you still won't be able to start a gesture over a disabled element)

Robbendebiene avatar Dec 06 '17 14:12 Robbendebiene

If I remember right you can track mouse-click events on disabled elements. You should just subscribe to the whole page.

Then you can analize target property to distinguish actions over img, links etc.

KES777 avatar Dec 06 '17 14:12 KES777

@KES777 Can you please show me an example of this, becuase thats what Gesturefy does and I also tried in my example if I'm understanding you right.

Robbendebiene avatar Dec 06 '17 16:12 Robbendebiene

I blame mozilla for this issue. The PR

KES777 avatar Dec 07 '17 08:12 KES777

Unrelated: You can easily grab text from screen with http://capture2text.sourceforge.net/. I use it a lot because bug reports are often described by screenshots.

bubblefoil avatar Jan 05 '18 10:01 bubblefoil