vue2-clock-picker icon indicating copy to clipboard operation
vue2-clock-picker copied to clipboard

Solved an issue with Microsoft Edge compatibility

Open usolved opened this issue 5 years ago • 1 comments

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 :).

usolved avatar Jul 24 '19 08:07 usolved

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

pencilpix avatar Jul 24 '19 09:07 pencilpix