-
Notifications
You must be signed in to change notification settings - Fork 295
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
Fix bug when mixin dgrid/extensions/DnD and dgrid/Selection #658
Conversation
…returs false. So in IE10 if you try to dedect a touch device 'has' reports false; but the browser fires events as MSPointerXXX. The feature detection is a little dirty if (window.navigator.msPointerEnabled) {...} else {...}; or maybe (has('ie') && has('ie') >= 10) Info source http://msdn.microsoft.com/en-us/library/ie/hh673557(v=vs.85).aspx
I can't seem to reproduce this issue in the test/Selection.html and test/extensions/DnD.html test pages - in the former, the Moreover, if I apply the change you suggested, the logic in Selection ends up triggering multiple times, which is not something we would want. Can you provide a reduced test case that shows the issue you're experiencing? |
Yes I'll provide a test case. One question: Did you have a test with all this mixins [OnDemandGrid, No matter what, I'll create a test case with this scenario and try to Tks, On Tue, Jul 23, 2013 at 11:57 AM, Kenneth G. Franqueiro <
Ing. Lorenzo Solano Martínez e-mail: lorenzo.sm@gmail.com Cell phone: +1-829-276-7676 LinkedIn: http://do.linkedin.com/pub/lorenzo-solano/33/551/a84 |
Yes, the grids in the DnD test page (which is one of the pages I tested with) include all of those mixins. Looking forward to your test case, thanks! |
…re is a problem with IE10 and MSPointerXXX events.
There you have it ( I tested the case using the latest (dev) version of Steps to reproduce (Failure)
Steps to reproduce (the "Fix")
Note: I don't know if, by design, dgrid's modules "trust" in dojo/on to normalize this kind of situation, that's why I'm not sure if the submitted code is the appropriated solution. |
Okay, when I first tested this I didn't realize the issue was specific to running against Dojo 1.9, so that was my problem. I can see the issue plainly in dgrid's DnD test page with Dojo 1.9.1 + IE10. Thanks for the extra info. |
You're welcome |
The problem
When mixin
dgrid/extensions/DnD
anddgrid/Selection
; using IE10 themousedown
event is reported asMSPointerDown
. Because the Selection module is not listening for this new event the Grid's selection is always empty. Because the DnD extension relies on the Grid's selection (if any) it does not work as the later is always empty.Tests
After testing in different borwsers (in a non-touch laptop), these are my findings about the event type reported:
IE (v 10.0.9200.16635, update 10.0.7)
evt.type = "MSPointerDown"
evt.type = "mousedown"
evt.type = "mousedown"
evt.type = "mousedown"
Chrome (v 29.0.1547.18 dev-m)
evt.type = "mousedown"
FireFox (v 22.0)
evt.type = "mousedown"
"Fix"
Add
MSPointerDown
andMSPointerUp
toSelection.selectionEvents
property.Little investigation (in commit message)
MSPointerXXX events are inconsistent with the fact that has('touch') returs false. So in IE10 if you try to dedect a touch device 'has' reports false; but the browser fires events as MSPointerXXX.
The feature detection is a little dirty
if (window.navigator.msPointerEnabled) { // Must listen for MSPointerXXX events } else { // Classic event types };
or maybe
if (has('ie') && has('ie') >= 10) {...}
Information source http://msdn.microsoft.com/en-us/library/ie/hh673557(v=vs.85).aspx