Element scrollIntoView() polyfill for Internet Explorer 11
Internet Explorer 11 has a bug in scrollIntoView(), which causes the whole page to move horizontally in some cases:
There are various workarounds, like using jQuery, but this can be a problem when running Selenium tests, something like this:
WebElement element = driver.;Actions actions = new Actions(driver);actions.;actions.;
Selenium's in-built handling of moveToElement is to use scrollIntoView().
What can be done instead, is to polyfill/fix the scrollIntoView() function itself, so that Selenium can use it.
You'll need jQuery in the project to use this polyfill. (It could probably be rewritten slightly to not use jQuery, if somebody looks into it. PRs accepted.)
1) Install it
npm install ie11-scroll-into-view --save
(or just download the script and put it in your project)
2) Import it
or with AMD:
or with CommonJS:
or with Harmony modules:
There is currently only one test, and we run it manually:
npm run dev
This will open a server, you can access it at http://localhost:8080. You can interact with the buttons on the page to see expected behavior.
It is possible to reproduce the IE 11 bug by
commenting out the
<script> tag that imports