Related to issue 40180: Wrong tab behavior on grid view in Firefox 65+. default tip
authorJavier Armendáriz <javier.armendariz@openbravo.com>
Wed, 20 Feb 2019 10:55:23 +0100
changeset 124 584977f88991
parent 123 4951a69bf1de
Related to issue 40180: Wrong tab behavior on grid view in Firefox 65+.

Applied a patch from latest Smartclient 12 code that prevents that keypress
events are fired twice for tab key in Firefox 65+.
web/org.openbravo.userinterface.smartclient/isomorphic/client/event/EventHandler.js
web/org.openbravo.userinterface.smartclient/isomorphic/system/development/ISC_Core.js
web/org.openbravo.userinterface.smartclient/isomorphic/system/modules-debug/ISC_Core.js
web/org.openbravo.userinterface.smartclient/isomorphic/system/modules/ISC_Core.js
--- a/web/org.openbravo.userinterface.smartclient/isomorphic/client/event/EventHandler.js	Wed Jan 23 12:37:54 2019 +0100
+++ b/web/org.openbravo.userinterface.smartclient/isomorphic/client/event/EventHandler.js	Wed Feb 20 10:55:23 2019 +0100
@@ -1186,7 +1186,12 @@
 _fireKeypressOnKeyDown : function (keyName) { return false; },
 
 // Mozilla
-_mozFireKeypressOnKeyDown : function (keyName) { 
+_mozFireKeypressOnKeyDown : function (keyName) {
+    // In FF 65 we have to cancel tab focus navigation on keyDown rather than keyPress
+    if (isc.Browser.isMoz && isc.Browser.version >= 65) {
+        if (keyName == this._$Tab) return true;
+    }
+
     return keyName == this._$f10 && this.shiftKeyDown();
 },
 
--- a/web/org.openbravo.userinterface.smartclient/isomorphic/system/development/ISC_Core.js	Wed Jan 23 12:37:54 2019 +0100
+++ b/web/org.openbravo.userinterface.smartclient/isomorphic/system/development/ISC_Core.js	Wed Feb 20 10:55:23 2019 +0100
@@ -1141,7 +1141,8 @@
 if(_5!=false&&_4.keyName){_3.$85t[_3.$85t.length]=_4.keyName}
 _3.$885=_4.ctrlKey;_3.$886=_4.altKey;if(_5!=false&&_11){_5=_3.handleKeyPress(_1);_3.$85z[_4.keyName]=true}
 if(_5==false){this.cancelKeyEvent(_1)}
-return _5},isc.A.$90x=function isc_c_EventHandler__fireKeypressOnKeyDown(_1){return false},isc.A.$947=function isc_c_EventHandler__mozFireKeypressOnKeyDown(_1){return _1==this.$je&&this.shiftKeyDown()},isc.A.$948=function isc_c_EventHandler__ieFireKeypressOnKeyDown(_1){var _2=isc.EH;if(_2.$i8[_1]!=null)return true;return _2.$944[_1]!=null&&_2.$949()},isc.A.$95a=function isc_c_EventHandler__safariFireKeypressOnKeyDown(_1){var _2=isc.EH;if(_2.$90v[_1]!=null)return true;return _2.$944[_1]!=null&&_2.$949()},isc.A.$949=function isc_c_EventHandler__modifierKeyDownOnly(_1){if(!_1)_1=this.lastEvent;if(isc.Browser.isMac)return _1.metaKey&&!_1.altKey&&!_1.shiftKey;else return _1.ctrlKey&&!_1.metaKey&&!_1.altKey&&!_1.shiftKey},isc.A.handleKeyDown=function isc_c_EventHandler_handleKeyDown(_1,_2){var _3=isc.EH,_4=_3.lastEvent,_5;var _6=_3.eventHandledNatively(_4.eventType,_4.nativeKeyTarget);if(_6)_5=_3.$js;if(_2!=null)isc.addProperties(_4,_2);if(!_6){var _7=[_4,_4.target,_4.keyName];var _8=_4.keyTarget;if(_8==null)_8=this.getEventTargetCanvas(_1,_4.nativeKeyTarget);if(_3.targetIsEnabled(_8)){_5=(_3.bubbleEvent(_8,_3.KEY_DOWN,_7)!=false)}}
+return _5},isc.A.$90x=function isc_c_EventHandler__fireKeypressOnKeyDown(_1){return false},isc.A.$947=function isc_c_EventHandler__mozFireKeypressOnKeyDown(_1){if(isc.Browser.isMoz&&isc.Browser.version>=65){if(_1==this.$jf)return true}
+return _1==this.$je&&this.shiftKeyDown()},isc.A.$948=function isc_c_EventHandler__ieFireKeypressOnKeyDown(_1){var _2=isc.EH;if(_2.$i8[_1]!=null)return true;return _2.$944[_1]!=null&&_2.$949()},isc.A.$95a=function isc_c_EventHandler__safariFireKeypressOnKeyDown(_1){var _2=isc.EH;if(_2.$90v[_1]!=null)return true;return _2.$944[_1]!=null&&_2.$949()},isc.A.$949=function isc_c_EventHandler__modifierKeyDownOnly(_1){if(!_1)_1=this.lastEvent;if(isc.Browser.isMac)return _1.metaKey&&!_1.altKey&&!_1.shiftKey;else return _1.ctrlKey&&!_1.metaKey&&!_1.altKey&&!_1.shiftKey},isc.A.handleKeyDown=function isc_c_EventHandler_handleKeyDown(_1,_2){var _3=isc.EH,_4=_3.lastEvent,_5;var _6=_3.eventHandledNatively(_4.eventType,_4.nativeKeyTarget);if(_6)_5=_3.$js;if(_2!=null)isc.addProperties(_4,_2);if(!_6){var _7=[_4,_4.target,_4.keyName];var _8=_4.keyTarget;if(_8==null)_8=this.getEventTargetCanvas(_1,_4.nativeKeyTarget);if(_3.targetIsEnabled(_8)){_5=(_3.bubbleEvent(_8,_3.KEY_DOWN,_7)!=false)}}
 return _5},isc.A.$kb=function isc_c_EventHandler__handleNativeKeyUp(_1){if(!isc.Page.isLoaded())return false;var _2=isc.EH,_3=_2.lastEvent;if(!_1)_1=_2.getWindow().event;_2.getKeyEventProperties(_1);_2.$885=_3.ctrlKey
 _2.$886=_3.altKey
 _2.$85z[_3.keyName]=null;if(_2.$85t.indexOf(_2.lastEvent.keyName)!=-1){if(_2.handleKeyPress(_1)==false){this.cancelKeyEvent(_1);return false}}
--- a/web/org.openbravo.userinterface.smartclient/isomorphic/system/modules-debug/ISC_Core.js	Wed Jan 23 12:37:54 2019 +0100
+++ b/web/org.openbravo.userinterface.smartclient/isomorphic/system/modules-debug/ISC_Core.js	Wed Feb 20 10:55:23 2019 +0100
@@ -29393,6 +29393,11 @@
 
 // Mozilla
 _mozFireKeypressOnKeyDown : function (keyName) {
+    // In FF 65 we have to cancel tab focus navigation on keyDown rather than keyPress
+    if (isc.Browser.isMoz && isc.Browser.version >= 65) {
+        if (keyName == this._$Tab) return true;
+    }
+
     return keyName == this._$f10 && this.shiftKeyDown();
 },
 
--- a/web/org.openbravo.userinterface.smartclient/isomorphic/system/modules/ISC_Core.js	Wed Jan 23 12:37:54 2019 +0100
+++ b/web/org.openbravo.userinterface.smartclient/isomorphic/system/modules/ISC_Core.js	Wed Feb 20 10:55:23 2019 +0100
@@ -1116,7 +1116,8 @@
 if(_5!=false&&_4.keyName){_3.$85t[_3.$85t.length]=_4.keyName}
 _3.$885=_4.ctrlKey;_3.$886=_4.altKey;if(_5!=false&&_11){_5=_3.handleKeyPress(_1);_3.$85z[_4.keyName]=true}
 if(_5==false){this.cancelKeyEvent(_1)}
-return _5},isc.A.$90x=function isc_c_EventHandler__fireKeypressOnKeyDown(_1){return false},isc.A.$947=function isc_c_EventHandler__mozFireKeypressOnKeyDown(_1){return _1==this.$je&&this.shiftKeyDown()},isc.A.$948=function isc_c_EventHandler__ieFireKeypressOnKeyDown(_1){var _2=isc.EH;if(_2.$i8[_1]!=null)return true;return _2.$944[_1]!=null&&_2.$949()},isc.A.$95a=function isc_c_EventHandler__safariFireKeypressOnKeyDown(_1){var _2=isc.EH;if(_2.$90v[_1]!=null)return true;return _2.$944[_1]!=null&&_2.$949()},isc.A.$949=function isc_c_EventHandler__modifierKeyDownOnly(_1){if(!_1)_1=this.lastEvent;if(isc.Browser.isMac)return _1.metaKey&&!_1.altKey&&!_1.shiftKey;else return _1.ctrlKey&&!_1.metaKey&&!_1.altKey&&!_1.shiftKey},isc.A.handleKeyDown=function isc_c_EventHandler_handleKeyDown(_1,_2){var _3=isc.EH,_4=_3.lastEvent,_5;var _6=_3.eventHandledNatively(_4.eventType,_4.nativeKeyTarget);if(_6)_5=_3.$js;if(_2!=null)isc.addProperties(_4,_2);if(!_6){var _7=[_4,_4.target,_4.keyName];var _8=_4.keyTarget;if(_8==null)_8=this.getEventTargetCanvas(_1,_4.nativeKeyTarget);if(_3.targetIsEnabled(_8)){_5=(_3.bubbleEvent(_8,_3.KEY_DOWN,_7)!=false)}}
+return _5},isc.A.$90x=function isc_c_EventHandler__fireKeypressOnKeyDown(_1){return false},isc.A.$947=function isc_c_EventHandler__mozFireKeypressOnKeyDown(_1){if(isc.Browser.isMoz&&isc.Browser.version>=65){if(_1==this.$jf)return true}
+return _1==this.$je&&this.shiftKeyDown()},isc.A.$948=function isc_c_EventHandler__ieFireKeypressOnKeyDown(_1){var _2=isc.EH;if(_2.$i8[_1]!=null)return true;return _2.$944[_1]!=null&&_2.$949()},isc.A.$95a=function isc_c_EventHandler__safariFireKeypressOnKeyDown(_1){var _2=isc.EH;if(_2.$90v[_1]!=null)return true;return _2.$944[_1]!=null&&_2.$949()},isc.A.$949=function isc_c_EventHandler__modifierKeyDownOnly(_1){if(!_1)_1=this.lastEvent;if(isc.Browser.isMac)return _1.metaKey&&!_1.altKey&&!_1.shiftKey;else return _1.ctrlKey&&!_1.metaKey&&!_1.altKey&&!_1.shiftKey},isc.A.handleKeyDown=function isc_c_EventHandler_handleKeyDown(_1,_2){var _3=isc.EH,_4=_3.lastEvent,_5;var _6=_3.eventHandledNatively(_4.eventType,_4.nativeKeyTarget);if(_6)_5=_3.$js;if(_2!=null)isc.addProperties(_4,_2);if(!_6){var _7=[_4,_4.target,_4.keyName];var _8=_4.keyTarget;if(_8==null)_8=this.getEventTargetCanvas(_1,_4.nativeKeyTarget);if(_3.targetIsEnabled(_8)){_5=(_3.bubbleEvent(_8,_3.KEY_DOWN,_7)!=false)}}
 return _5},isc.A.$kb=function isc_c_EventHandler__handleNativeKeyUp(_1){if(!isc.Page.isLoaded())return false;var _2=isc.EH,_3=_2.lastEvent;if(!_1)_1=_2.getWindow().event;_2.getKeyEventProperties(_1);_2.$885=_3.ctrlKey
 _2.$886=_3.altKey
 _2.$85z[_3.keyName]=null;if(_2.$85t.indexOf(_2.lastEvent.keyName)!=-1){if(_2.handleKeyPress(_1)==false){this.cancelKeyEvent(_1);return false}}