Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gestures don't work on disabled input elements #199

Open
KES777 opened this issue Dec 5, 2017 · 9 comments
Open

Gestures don't work on disabled input elements #199

KES777 opened this issue Dec 5, 2017 · 9 comments

Comments

@KES777
Copy link

KES777 commented Dec 5, 2017

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

@Robbendebiene
Copy link
Owner

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)

@KES777
Copy link
Author

KES777 commented Dec 5, 2017

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

@Robbendebiene
Copy link
Owner

@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
Copy link
Owner

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)

@KES777
Copy link
Author

KES777 commented Dec 6, 2017

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.

@Robbendebiene
Copy link
Owner

@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.

@KES777
Copy link
Author

KES777 commented Dec 7, 2017

I blame mozilla for this issue.
The PR

@Robbendebiene Robbendebiene changed the title gestures did not work in some cases Gestures don't work on disabled input elements Dec 10, 2017
@bubblefoil
Copy link

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.

@Robbendebiene
Copy link
Owner

Some updates:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants