Baremetrics / calendar

Date range picker for Baremetrics
MIT License
679 stars 78 forks source link

f.path is undefined in Firefox #87

Closed gerdus closed 5 years ago

gerdus commented 6 years ago

In Firefox(60) clicking outside the calendar gives following error in console and does not close it: f.path is undefined error on this line (Calendar.js line 189) var contains = self.element.find(f.path[0]);

event.path is non-standard; standard seems to be event.composedPath() Fixed it locally with: var path = f.path || (f.composedPath && f.composedPath()) || [f.target.parentNode,]; var contains = self.element.find(path[0]); Edge does not support either so faked a path with event.target.

leonardofaria commented 5 years ago

@gerdus I am having the same issue and I found another way to fix it.

I am trying to test what you did locally could you please detail a bit more?

gerdus commented 5 years ago

Looking at it again looks like this was fixed in 1.0.12 (latest on NPM is still v1.0.11) in 1.0.11 the line was var contains = self.element.find(f.path[0]);