AnanthaKN / jquery-in-place-editor

Automatically exported from code.google.com/p/jquery-in-place-editor
Other
0 stars 0 forks source link

Feature Request - save-on-tab #140

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'd like to be able to use the tab key to move from field to field,
with the editor saving each field as I tab out of it.  This would be similar to 
the behavior of HTML forms.

Original issue reported on code.google.com by jkai...@gmail.com on 9 Aug 2014 at 1:15

GoogleCodeExporter commented 9 years ago
I took a stab at implementing this.  Since the edit-in-place cells are not HTML 
forms, Firefox doesn't know that a tab should go there.  So I made an array of 
DOM entries, one for each Editor.  In the piece of code that looks for an ESC ( 
code 27 ) , I added code for the tab  ( code 9 ).  The new code makes the 
editor do a save, and then called jquery.focus() to move to the next item in 
the array.

   Unfortunately, it doesn't work.  The tab key is special to the browser, and it treats it specially.  Yes, the code 9 is sent to the editor, but then the browser sends focus to the next HTML form input.  If there are no forms on the page, it will probably send focus to the browser command bar or URL window.  At least that's what Ff does.  I have no idea about IE or Safari or Chrome or .....

   In short, messing with the TAB key is a fairly big deal, and I understand why the author didn't do it.  One of those things which - if I was still doing this for a living - I'd go back to the Boss and say "Are you sure you want this?  Because it's going to add a week to the schedule."

Original comment by jkai...@gmail.com on 11 Aug 2014 at 4:32