public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ganesh Jaybhay <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: Fix in switch cell tab navigation
Date: Wed, 25 Mar 2020 15:21:39 +0530
Message-ID: <CAK6syAppD_do9JQkdyQA96vsFQys97d5p3D_Ud_eCfvpoCp=Vg@mail.gmail.com> (raw)

Hi Hackers,

Attached is the patch for below minor fix in the switch cell tab navigation:

After pressing the tab key on switch cell, sometimes focus doesn't go to
the immediate next editable cell. It goes to the different cell for
fraction of seconds and again comes to the next editable cell.

Please review.

Regards,
Ganesh Jaybhay


Attachments:

  [application/x-patch] switch_cell_navigation.patch (1.8K, 3-switch_cell_navigation.patch)
  download | inline diff:
diff --git a/web/pgadmin/static/js/backgrid.pgadmin.js b/web/pgadmin/static/js/backgrid.pgadmin.js
index 230d7ce56..61127ddb1 100644
--- a/web/pgadmin/static/js/backgrid.pgadmin.js
+++ b/web/pgadmin/static/js/backgrid.pgadmin.js
@@ -206,7 +206,7 @@ define([
             renderable = Backgrid.callByNeed(cell.column.renderable(), cell.column, cell.model);
             editable = Backgrid.callByNeed(cell.column.editable(), cell.column, model);
             if(cell && cell.$el.hasClass('edit-cell') &&
-              !cell.$el.hasClass('privileges') || cell.$el.hasClass('delete-cell')) {
+              !cell.$el.hasClass('privileges') || cell.$el.hasClass('delete-cell') || cell.$el.hasClass('subgrid-cell')) {
               model.trigger('backgrid:next', m, n, false);
               if(cell.$el.hasClass('delete-cell')) {
                 setTimeout(function(){
@@ -717,7 +717,11 @@ define([
           gotoCell = e.shiftKey ? self.$el.prev() : self.$el.next();
         }
 
-        if (gotoCell) {
+        if (gotoCell && gotoCell.length > 0) {
+          if(gotoCell.hasClass('editable')){
+            e.preventDefault();
+            e.stopPropagation();
+          }
           let command = new Backgrid.Command({
             key: 'Tab',
             keyCode: 9,
@@ -727,12 +731,8 @@ define([
           setTimeout(function() {
             // When we have Editable Cell
             if (gotoCell.hasClass('editable') && gotoCell.hasClass('edit-cell')) {
-              e.preventDefault();
-              e.stopPropagation();
               gotoCell.trigger('focus');
             } else if (gotoCell.hasClass('editable')) {
-              e.preventDefault();
-              e.stopPropagation();
               setTimeout(function() {
                 self.model.trigger('backgrid:edited', self.model,
                   self.column, command);


view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Fix in switch cell tab navigation
  In-Reply-To: <CAK6syAppD_do9JQkdyQA96vsFQys97d5p3D_Ud_eCfvpoCp=Vg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox