Shift tab not retaining element focus


John Smith

Javascript version code - link

 if (el.value.length > 1) {
    el.value = el.value[el.value.length - 1];
  }
  try {
    if (el.value == null || el.value == "") {
      this.foucusOnInput(el.previousElementSibling);
    } else {
      this.foucusOnInput(el.nextElementSibling);
    }
  } catch (e) {
    console.log(e);
  }

AngularJS version code - link

if (ele.currentTarget.value.length >= 1) {
            ele.currentTarget.value = ele.currentTarget.value[ele.currentTarget.value.length - 1];
  }
        try {
            if (ele.currentTarget.value === null || ele.currentTarget.value === "") {
                foucusOnInput(ele.currentTarget.previousElementSibling);
            } else {
                foucusOnInput(ele.currentTarget.nextElementSibling);
            }
        } catch (e) {
            console.log(e);
        }

Unimplemented javascript version

Tab&Shift + Tab

Functions in AngularJS. Let me know what's missing here!

Requirements - After entering a value in an input text, the next input text element should be focused; on Shift-Tab, the previous input text element should be focused.

John Smith

Working solution - link

if(ele.key != "Tab" && ele.key != "Shift" ){
            if (ele.currentTarget.value.length >= 1) {
                ele.currentTarget.value = ele.currentTarget.value[ele.currentTarget.value.length - 1];
            }
            try {
                if (ele.currentTarget.value === null || ele.currentTarget.value === "") {
                    foucusOnInput(ele.currentTarget.previousElementSibling);
                } else {
                    foucusOnInput(ele.currentTarget.nextElementSibling);
                }
            } catch (e) {
                console.log(e);
            }
        }

Related


Shift tab not retaining element focus

John Smith Javascript version code - link if (el.value.length > 1) { el.value = el.value[el.value.length - 1]; } try { if (el.value == null || el.value == "") { this.foucusOnInput(el.previousElementSibling); } else { this.foucusOnI

Shift tab not retaining element focus

John Smith Javascript version code - link if (el.value.length > 1) { el.value = el.value[el.value.length - 1]; } try { if (el.value == null || el.value == "") { this.foucusOnInput(el.previousElementSibling); } else { this.foucusOnI

Shift tab not retaining element focus

John Smith Javascript version code - link if (el.value.length > 1) { el.value = el.value[el.value.length - 1]; } try { if (el.value == null || el.value == "") { this.foucusOnInput(el.previousElementSibling); } else { this.foucusOnI

Shift focus from index to body of active tab and focus link first

Shakil Ahmad When the first index is selected, I have a tab, and when I press the tab key, the focus moves to the next index, but here, I want to focus the first link in the body of the first index. Here is my code. When Tab1 is selected and Tab is pressed, Ta

Shift focus from index to body of active tab and focus link first

Shakil Ahmad When the first index is selected, I have a tab, and when I press the tab key, the focus moves to the next index, but here, I want to focus the first link in the body of the first index. Here is my code. When Tab1 is selected and Tab is pressed, Ta

Shift recyclerview focus to last element in list

div I am using recyclerview to display messages in chat window. However, when editing a new message, the focus of the recycler view should be on the last element. I was hoping that there would be some way to shift the focus of the recyclerview to the last elem

Shift recyclerview focus to last element in list

div I am using recyclerview to display messages in chat window. However, when editing a new message, the focus of the recycler view should be on the last element. I was hoping there would be some way to shift the focus of the recyclerview to the last element i

Shift recyclerview focus to last element in list

div I am using recyclerview to display messages in chat window. However, when editing a new message, the focus of the recycler view should be on the last element. I was hoping that there would be some way to shift the focus of the recyclerview to the last elem

Shift recyclerview focus to last element in list

div I am using recyclerview to display messages in chat window. However, when editing a new message, the focus of the recycler view should be on the last element. I was hoping that there would be some way to shift the focus of the recyclerview to the last elem

Shift recyclerview focus to last element in list

div I am using recyclerview to display messages in chat window. However, when editing a new message, the focus of the recycler view should be on the last element. I was hoping that there would be some way to shift the focus of the recyclerview to the last elem

jQuery focus on the first form element on the last tab

username I am trying to make the cursor jump to the first element of the form. For some reason it keeps focusing on the second element, not the first. I just made a simple form. <form> <input type="text"> <input type="text"> <input type="text"> <input

Use Tab key to move focus from datagrid to next page element

Matt Using AG-Grid, I need to be able to press the Tab key and have the focused element change from the currently selected grid/cell to the next element on the page outside the grid. The problem is that the tabs seem to be locked inside the grid and don't move

Use Tab key to move focus from datagrid to next page element

Matt Using AG-Grid, I need to be able to press the Tab key and have the focused element change from the currently selected grid/cell to the next element on the page outside the grid. The problem is that the tabs seem to be locked inside the grid and don't move

shift focus() - Angular 5

Snake I have the following code in Angular 5: <select class="abc" (change)="items($event)"  required> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option va

Master page tab control not retaining postback value

Simon Price I have an AJAX Extender Calendar control on my home page. When I fire the selection change event (below), it pulls the information back and then shows it to the label control, however, when navigating to other pages in the site, it loses the inform

Master page tab control not retaining postback value

Simon Price I have an AJAX Extender Calendar control on my home page. When I fire the selection change event (below), it pulls the information back and then shows it to the label control, however, when navigating to other pages in the site, it loses the inform

Master page tab control not retaining postback value

Simon Price I have an AJAX Extender Calendar control on my home page. When I fire the selection change event (below), it pulls the information back and then shows it to the label control, however, when navigating to other pages in the site, it loses the inform

KeyEventArgs Shift + Tab

pear tree blossom I want to use this method to create KeyEvent "SHIFT+TAB". How can I set the Shift key as a modifier? Dim args As New System.Windows.Input.KeyEventArgs(Keyboard.PrimaryDevice, Keyboard.PrimaryDevice.ActiveSource, 0, Key.Tab) args.RoutedEvent =

Shift-Tab in tmux

crazy Currently I have this binding .tmux.configto go to the next window: bind-key -n Tab next-window I want to make the Shift+ Tabloop go in the opposite direction. is it possible? I tried bind-key -n S-Tab previous-window; but it doesn't work. Kamil Macioro

tab focus on select box

Encoder I'm trying to display the focused state of a select box in a htmlform . When passing on the elements in the table, which is pretty much all of my tab input type="text"'s elements, the focus works as I specified in the CSS, but when the tab gets focus t

Get focus (or tab) order

gpalex I have designed a user interface using Qt Designer and I have set the tab order using the "Edit Tab Order" mode. Now, I'm wondering (for other reasons, not so important) how to get the tab order for a particular QWidget in the ui? I mean, if I have seve

Add focus to current tab

li97 I am trying to open a page in a new tab, but it always makes the newly opened tab active. I want the current tab to be active and the new page should open in the background. I'm trying to do it with a function without any <a>labels . What I have tried: na

Get focus (or tab) order

gpalex I have designed a user interface using Qt Designer and I have set the tab order using the "Edit Tab Order" mode. Now, I'm wondering (for other reasons, not so important) how to get the tab order for a particular QWidget in the ui? I mean, if I have seve

tab focus on select box

Encoder I'm trying to display the focused state of a select box in a htmlform . When passing on the elements in the table, which is pretty much all of my tab input type="text"'s elements, the focus works as I specified in the CSS, but when the tab gets focus t

jTabbedPane shift focus to next table

Discover: Problem Description I'm currently writing an application for manually copying data from a sheet of paper to a database. The app has tons of widgets where users can enter data. To keep the UI uncluttered, I decided to use tabbed panes, dividing the in

jTabbedPane shift focus to next table

Discover: Problem Description I'm currently writing an application for manually copying data from a sheet of paper to a database. The app has tons of widgets where users can enter data. To keep the UI uncluttered, I decided to use tabbed panes, dividing the in

jTabbedPane shift focus to next table

Discover: Problem Description I'm currently writing an application for manually copying data from a sheet of paper to a database. The app has tons of widgets where users can enter data. To keep the UI uncluttered, I decided to use tabbed panes, dividing the in