Skip to content

Commit 10f2d89

Browse files
javier-godoymlopezFC
authored andcommitted
fix: use composedPath if event.path is not available
Close #2
1 parent 967815b commit 10f2d89

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/resources/META-INF/frontend/fc-year-calendar/fc-year-calendar.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,13 @@ export class FcYearCalendarElement extends ThemableMixin(PolymerElement) {
180180
_onKeyDown(ev) {
181181

182182
const isMonthCalendar = elem => elem.tagName.toLowerCase()=="fc-month-calendar";
183+
let path = ev.path || (ev.composedPath && ev.composedPath());
183184

184-
if (ev.path.length<3 || !isMonthCalendar(ev.path[2])) {
185+
if (!path || path.length<3 || !isMonthCalendar(path[2])) {
185186
return;
186187
}
187188

188-
const monthCalendar = ev.path[2];
189+
const monthCalendar = path[2];
189190
const key = monthCalendar._eventKey(ev);
190191
if (!key) return;
191192

0 commit comments

Comments
 (0)