Skip to content

Tabs (again) #16

Description

@sdmonkey

I hope its OK to post this here... I saw other posts regarding the use of the TAB so I figured I'd post a new item instead of commenting in one of the older issues; especially since they have been closed..?

Essentially, I would like to change two things.1. Stop giving focus to the cloned 'hint' node. 2. Be able to move beyond the txtInput field after I have accepted a value; using the TAB.

This could be accomplished by:
Adding this attribute def.

txtHint.tabIndex = '-1'; // won't work in all browsers...http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 

Adding this var before the keyDownHandler

var lastKeyHandled = ''; // see if stmt below

And replacing this:

if (keyCode == 9) { // for tabs we need to ensure that we override the default behaviour: move to the next focusable HTML-element 
                e.preventDefault();
                e.stopPropagation();
                if (txtHint.value.length == 0) {
                    rs.onTab(); // tab was called with no action.
                                // users might want to re-enable its default behaviour or handle the call somehow.
                }
            }

With this:

if (keyCode == 9) { // for tabs we need to ensure that we override the default behaviour: move to the next focusable HTML-element 
               if(keyCode != lastKeyHandled){ // if the tab was the last keyCode handled, allow movement to next tab index item
                  if ( e.preventDefault ) e.preventDefault();
                  //e.preventDefault(); IE Error
                  if ( e.stopPropagation ) e.stopPropagation();
                  //e.stopPropagation(); IE Error
                  if (txtHint.value.length == 0) {
                    rs.onTab(); // tab was called with no action.
                                // users might want to re-enable its default behaviour or handle the call somehow.
                  }
               }
            }
            lastKeyHandled = keyCode; //

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions