mindmup / editable-table

tiny jQuery/Bootstrap widget that makes a HTML table editable
MIT License
686 stars 324 forks source link

TAB doesn't work on Firefox #26

Open harvimt opened 8 years ago

harvimt commented 8 years ago

pressing TAB when the editor is open, opens the cell to the right in chrome, but not firefox on mac. in firefox pressing tab just results in the cell losing focus. (often going to the url bar)

harvimt commented 8 years ago

fixed with:

diff --git a/public/js/mindmup-editabletable.js b/public/js/mindmup-editabletable.js
index 36be540..9aec7c0 100755
--- a/public/js/mindmup-editabletable.js
+++ b/public/js/mindmup-editabletable.js
@@ -70,7 +70,10 @@ $.fn.editableTableWidget = function (options) {
                editor.hide();
                active.focus();
            } else if (e.which === TAB) {
-               active.focus();
+               e.preventDefault();
+               e.stopPropagation();
+               editor.hide();
+               active.next('td').focus().click();
            } else if (this.selectionEnd - this.selectionStart === this.value.length) {
                var possibleMove = movement(active, e.which);
                if (possibleMove.length > 0) {
``
ermanimer commented 8 years ago

after this fix, tab works but doesn't passes to next row.

hydrogen2oxygen commented 8 years ago

This worked for me:

else if (e.which === TAB) {

            e.preventDefault();
            e.stopPropagation();

            if (active.next('td').length == 0) {
                active.closest('tr').next().find('td:first-child').focus().click();
            } else {
                active.next('td').focus().click();
            }
        }
DRSDavidSoft commented 7 years ago

Would the author (@mindmup) fix this issue with the #32 PR already...

loki0609 commented 6 years ago

active.closest('tr').next().find('td:first-child').focus().click(); didn't work for me on firefox this did however active.closest('tr').next().find('td').first().focus().click();