Skip to content

Commit

Permalink
fix: fix IE11 #dropdown issue with scrollTo / scrollTop on keyboard u…
Browse files Browse the repository at this point in the history
…sage / navigation
  • Loading branch information
tujoworker committed Apr 23, 2019
1 parent 86e4388 commit d03c12b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/dnb-ui-lib/src/components/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,13 @@ export default class Dropdown extends Component {
)
const top = liElement.offsetTop
const { parentNode } = liElement
if (parentNode.scrollTo) {
parentNode.scrollTop = top
}
if (scrollTo && parentNode.scrollTo) {
parentNode.scrollTo({
top,
behavior: 'smooth'
})
} else if (parentNode.scrollTop) {
parentNode.scrollTop = top
}
} catch (e) {
console.log('Dropdown could not scroll into element:', e)
Expand Down

0 comments on commit d03c12b

Please sign in to comment.