Skip to content

Commit 0a2127b

Browse files
authored
Merge pull request #2119 from kush-savani/issue-2111
fix: fix focus change issue when tab key press
2 parents 9e8a31e + 4f3113a commit 0a2127b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/search/search.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,17 @@ export class Search implements ControlValueAccessor {
243243
}
244244
}
245245

246+
@HostListener("focusin", ["$event"])
247+
focusIn(event) {
248+
this.onTouched();
249+
// set input focus if search icon get focus from tab key press event.
250+
if ((this.expandable || this.toolbar) &&
251+
this.inputRef && !event.relatedTarget &&
252+
!(this.elementRef.nativeElement as HTMLElement).contains(event.relatedTarget) ) {
253+
this.openSearch();
254+
}
255+
}
256+
246257
/**
247258
* Called when using IME composition.
248259
*/

0 commit comments

Comments
 (0)