vue2-clock-picker
vue2-clock-picker copied to clipboard
Solved an issue with Microsoft Edge compatibility
Sorry that I didn't make a pull request for this. But hopefully it'll help somebody who searches for this problem, likes to have Edge compatibility or want to make a PR. The function "getBoundingClientRect" doesn't have "x" and "y" available in Edge. But these values are also stored in "left" and "top". So rewriting the following will then also work with Edge:
calculateLastEvent: function calculateLastEvent(t) {
...
//instead of
r = o.x + this.width / 2,
s = o.y + this.width / 2,
//rewrite to
r = o.left + this.width / 2,
s = o.top + this.width / 2,
...
}
It's also possible to have IE11 compatbility when replacing all "includes" with "indexOf". For example:
//instead of
var e = t.disabled.includes(t.defaultValue);
//rewrite to
var e = t.disabled.indexOf(t.defaultValue) > -1;
The only problem left for IE11 is to polyfill "find" with the following: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/find#Polyfill
Thanks for this really nice and well designed component. Looking forward to use it :).
Hi @usolved , Thanks for the solutions you provide here. it's ok not to make a PR I will add them and merge ASAP.
Thanks so much for being interested to use this component