Ngx focus control

Library to provide tools to work with focus and focusable elements to improve user interfaces and accessibility.

npm versionCircleCICoverage StatusGitHub issuesnpm bundle sizeNPMdemostack blitzGitter
logo
Angular library to provide tools to work with focus and focusable elements to improve user interfaces and accessibility.
npm install ngx-focus-control --save

Focus unleavable directive

The directive does not allow leaving a focusable element when the provided condition is met.


Example shows the input, that you can not leave until you write at least 5 characters. Focus the input and try to leave it using the keyboard (TAB and SHIFT + TAB). Write at least 5 characters and try to leave the input again.


Code

<input placeholder="Input 1" class="input" [(ngModel)]="inputContent" [fuUnleavable]="inputContent.length < 5">