Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

change tabindex and add custom validation #1737

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

philippdrebes
Copy link

Changed the tabindex behavior, so that it is possible to set the tabindex of the input field. Before it was not possible to tab into the input field and type.

Added a property, that allows to set a custom validation method, which is executed on blur. Works when selecting a value by mouse (click), enter or when tabbing out of the input field. Can be used as a workaround for ng-blur.

Change the tabindex so that it can be set from outside.
The change also allows to interact with the select after tabbing in.
Before it was not possible to type without clicking on the element first.
Add property to add custom validation methods, that will be executed on
blur. Acts as workaround for ng-blur when tabbing out of text input.
@user378230
Copy link
Contributor

Is it necessary to set tabindex on searchInput? It is set on focusInput already.

Can you provide plunkr to demonstrate where this causes a problem?

You can create a custom directive for on-blur functionality. See (Accessing $select)[https://github.com/angular-ui/ui-select/wiki/Accessing-%24select]

@philippdrebes
Copy link
Author

philippdrebes commented Aug 16, 2016

Is it necessary to set tabindex on searchInput? It is set on focusInput already.

I have the requirement, that the user should be able to tab inside a table column. In order to achieve that I've set tabindex manually.

This plunkr shows the behavior without my changes: http://plnkr.co/z8e2sp

If you just tab through the fields it works as it should, but as soon as you type in the focused ui-select and tab out, the tabindex is no longer in the correct order.

tabindex behavior

Now the same plunkr with the modified ui-select code: http://plnkr.co/1UVtIH
tabindex behavior

You can create a custom directive for on-blur functionality. See (Accessing $select)

Ok, I will try that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants