Skip to content

Solved an issue with Microsoft Edge compatibility #10

@usolved

Description

@usolved

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions