-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Control.Layers: stop relying on Browser android
and touch
properties
#7057
Conversation
f312c26
to
f38b12a
Compare
Code from 4e2fe35 replaced with plain It seems that this is not sole place where Lines 205 to 206 in 436430d
To do:
|
Another alternative: use In year or two pointer events support should be wide enough to adopt this approach. |
f086c56
to
5c95d6d
Compare
- `android` is useless here, as there are a lot of non-android touch devices (including desktop ones) - `touch` is useless, as mouse can be used on touch-screen too Now these usecases are covered: - `mouseenter/leave` are handled on touch devices too - If Layers control created with {collapsed:false}, and than it collapsed explicitly [using .collapse() method], it's now possible to expand it back with click.
… touch Most browsers produce compatibility mouseenter for touch event, but not all, so we listen for click also. The problem is that these compatibility events come all in single batch, so same touch induces expand and then immediate input switching. To avoid this we temporarily prevent click on layers section. Note: more straight-forward way would be relying on e.sourceCapabilities.firesTouchEvents, but atm it has rather low support: https://caniuse.com/#feat=mdn-api_inputdevicecapabilities_firestouchevents
5c95d6d
to
e913763
Compare
PR improved. |
Control.Layers: stop relying on Browser
android
andtouch
propertiesandroid
is useless here, as there are a lot of non-android touch devices (including desktop ones)touch
is useless, as mouse can be used on touch-screen tooNow these use cases are covered:
mouseenter/leave
are handled on touch devices tooWith this PR mouse attached to device with touch support behaves as it should: reacts on
mouseover/out
events.But that is up on browser support, e.g. Chrome on android does not produce
mousemove/over/out
events.(But Firefox does)
If Layers control created with
{collapsed:false}
, and than it collapsed explicitly[using .collapse() method], it's now possible to expand it back with click.
Fix #6579.
Fix unexpected layer switching when expanding control on touch
Most browsers produce compatibility
mouseenter
for touch event, but not all,so we listen for click also.
The problem is that these compatibility events come all in single batch, so
same touch induces expand and then immediate input switching.
To avoid this we temporarily prevent click on layers section.
Note: more straight-forward way would be relying on
e.sourceCapabilities.firesTouchEvents
,but atm it has rather low support: https://caniuse.com/#feat=mdn-api_inputdevicecapabilities_firestouchevents
Related discussions: #6978, #7022.
Test page: https://gist.githack.com/johnd0e/a854f95019bb1a4c1ae909fbc6769d35/raw/pr-7057.html