Files
dc/client/src/app/directives/steal-focus.directive.ts
Mihajlo Medjedovic e98f288302
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 1m16s
style: lint
2024-05-30 09:47:38 +02:00

18 lines
417 B
TypeScript

import { Directive, HostListener } from '@angular/core'
@Directive({
selector: '[appStealFocus]'
})
export class StealFocusDirective {
constructor() {}
/**
* For some reason newest version of Clarity v17.0.1 is stealing focus when
* clicking on the input inside of the clr-tree-view
* This is workaround
*/
@HostListener('click', ['$event']) onClick(event: any) {
event.target.focus()
}
}