Skip to content

Commit e8a98da

Browse files
ShawnLee2018bartsidee
authored andcommitted
used in elements that contain tabindex (#1)
* used in elements that contain tabindex
1 parent 8baaa0b commit e8a98da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/focus.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ export class FocusElement {
124124
} catch (e) {}
125125
}
126126
}
127-
// set 'native' browser focus on input elements
128-
if (this.$el && (this.$el.nodeName === "INPUT" || this.$el.nodeName === "TEXTAREA")) this.$el.focus();
127+
// set 'native' browser focus on input elements and focusable elements.
128+
if (this.$el && ( this.$el.tabIndex !== -1 || this.$el.nodeName === "INPUT" || this.$el.nodeName === "TEXTAREA")) this.$el.focus();
129129
}
130130

131131
// remove focus from element

0 commit comments

Comments
 (0)