Open saschanaz opened 6 years ago
:man_shrugging: do you have an argument or reasoning to change it that is currently broken?
Recalling what was the problem... Ah, it caused feature detection to falsely fail, as the code expected Element.prototype.scrollIntoView
to exist.
That's a good point. MDN has .scrollIntoView()
listed under Element
, which is backed up by the CSSOM View Module spec.
Looks like it should prefer Element
over HTMLElement
. I haven't tested this with other implementations of Element, like SVGElement, but it sounds like it should work in browsers that support the extension, and so this polyfill should allow that, as well.
Possibly related to #153
I found that the code prefers HTMLElement to Element:
https://github.com/iamdustan/smoothscroll/blob/8a19e81e17ba39efed1c8b48c7976e3702238105/src/smoothscroll.js#L18
...and causes adding
scrollIntoView()
toHTMLElement
instead ofElement
. What was the reasoning there?