From 5786c175693405b98f1d662da2b7dcb1b6343041 Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Fri, 17 May 2019 16:27:14 +0100 Subject: [PATCH] Fix navigation of switch cells in grids. Fixes #4269 --- docs/en_US/release_notes_4_7.rst | 3 ++- web/pgadmin/static/js/backgrid.pgadmin.js | 18 +++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/en_US/release_notes_4_7.rst b/docs/en_US/release_notes_4_7.rst index f764df9ad..0f7e718e4 100644 --- a/docs/en_US/release_notes_4_7.rst +++ b/docs/en_US/release_notes_4_7.rst @@ -23,4 +23,5 @@ Bug fixes | `Bug #4245 `_ - Ensure that element should get highlighted when they get focus on using Tab key. | `Bug #4246 `_ - Fixed console error when subnode control is used in panels. | `Bug #4261 `_ - Stop using application/x-javascript as a mime type and use the RFC-compliant application/javascript instead. -| `Bug #4262 `_ - Fixed error on displaying table properties of a table partitioned by list having a default partition. \ No newline at end of file +| `Bug #4262 `_ - Fixed error on displaying table properties of a table partitioned by list having a default partition. +| `Bug #4269 `_ - Fix navigation of switch cells in grids. \ No newline at end of file diff --git a/web/pgadmin/static/js/backgrid.pgadmin.js b/web/pgadmin/static/js/backgrid.pgadmin.js index b717230ca..804dc92da 100644 --- a/web/pgadmin/static/js/backgrid.pgadmin.js +++ b/web/pgadmin/static/js/backgrid.pgadmin.js @@ -545,20 +545,24 @@ define([ } if (gotoCell) { + let command = new Backgrid.Command({ + key: 'Tab', + keyCode: 9, + which: 9, + shiftKey: e.shiftKey, + }); setTimeout(function() { + // When we have Editable Cell if (gotoCell.hasClass('editable')) { e.preventDefault(); e.stopPropagation(); - var command = new Backgrid.Command({ - key: 'Tab', - keyCode: 9, - which: 9, - shiftKey: e.shiftKey, - }); self.model.trigger('backgrid:edited', self.model, self.column, command); - this.exitEditMode(); gotoCell.trigger('focus'); + } else { + // When we have Non-Editable Cell + self.model.trigger('backgrid:edited', self.model, + self.column, command); } }, 20); }