Commit cbc70b1c authored by Julia Radzhabova's avatar Julia Radzhabova

[SSE] fixed bug 32671

parent cb452508
...@@ -49,12 +49,14 @@ function onDropDownKeyDown(e) { ...@@ -49,12 +49,14 @@ function onDropDownKeyDown(e) {
if ($parent.hasClass('no-stop-propagate')) { if ($parent.hasClass('no-stop-propagate')) {
if (arguments.length>1 && arguments[1] instanceof KeyboardEvent) if (arguments.length>1 && arguments[1] instanceof KeyboardEvent)
e = arguments[1]; e = arguments[1];
if ( /^(38|40|27|13|9)$/.test(e.keyCode) && !e.ctrlKey && !e.altKey) { if ( /^(38|40|27|13|9|37|39)$/.test(e.keyCode) && !e.ctrlKey && !e.altKey) {
patchDropDownKeyDownAdditional.call(this, e); patchDropDownKeyDownAdditional.call(this, e);
e.preventDefault(); if (!/(37|39)/.test(e.keyCode)) {
e.stopPropagation(); e.preventDefault();
e.stopPropagation();
}
} }
} else if ( !$parent.hasClass('no-stop-propagate') || /^(38|40|27|13|9)$/.test(e.keyCode) && !e.ctrlKey && !e.altKey) { } else {
patchDropDownKeyDown.call(this, e); patchDropDownKeyDown.call(this, e);
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
...@@ -142,15 +144,17 @@ function patchDropDownKeyDownAdditional(e) { // only for formula menu when typin ...@@ -142,15 +144,17 @@ function patchDropDownKeyDownAdditional(e) { // only for formula menu when typin
var $this = $(this); var $this = $(this);
e.preventDefault(); if (!/(37|39)/.test(e.keyCode)) {
e.stopPropagation(); e.preventDefault();
e.stopPropagation();
}
if ($this.is('.disabled, :disabled')) return; if ($this.is('.disabled, :disabled')) return;
var $parent = getParent($this); var $parent = getParent($this);
var isActive = $parent.hasClass('open') || $parent.hasClass('over'); var isActive = $parent.hasClass('open') || $parent.hasClass('over');
if (!isActive || (isActive && e.keyCode == 27)) { if (!isActive || (isActive && (e.keyCode == 27 || e.keyCode == 37 || e.keyCode == 39))) {
// if (e.which == 27) // if (e.which == 27)
// $parent.find('[data-toggle=dropdown]').focus(); // $parent.find('[data-toggle=dropdown]').focus();
return (isActive) ? $this.click() : undefined; return (isActive) ? $this.click() : undefined;
......
...@@ -95,11 +95,12 @@ define([ ...@@ -95,11 +95,12 @@ define([
onInputKeyDown: function(e) { onInputKeyDown: function(e) {
if (Common.UI.Keys.UP === e.keyCode || Common.UI.Keys.DOWN === e.keyCode || if (Common.UI.Keys.UP === e.keyCode || Common.UI.Keys.DOWN === e.keyCode ||
Common.UI.Keys.TAB === e.keyCode || Common.UI.Keys.RETURN === e.keyCode || Common.UI.Keys.ESC === e.keyCode) { Common.UI.Keys.TAB === e.keyCode || Common.UI.Keys.RETURN === e.keyCode || Common.UI.Keys.ESC === e.keyCode ||
Common.UI.Keys.LEFT === e.keyCode || Common.UI.Keys.RIGHT === e.keyCode) {
var menu = $('#menu-formula-selection'); // for formula menu var menu = $('#menu-formula-selection'); // for formula menu
if (menu.hasClass('open')) if (menu.hasClass('open'))
menu.find('.dropdown-menu').trigger('keydown', e); menu.find('.dropdown-menu').trigger('keydown', e);
} }
}, },
onLaunch: function() { onLaunch: function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment