From d03c12bf2e048303344b76c8f815a6a0f2966990 Mon Sep 17 00:00:00 2001 From: Tobias Date: Tue, 23 Apr 2019 21:24:57 +0200 Subject: [PATCH] fix: fix IE11 #dropdown issue with scrollTo / scrollTop on keyboard usage / navigation --- packages/dnb-ui-lib/src/components/dropdown/Dropdown.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/dnb-ui-lib/src/components/dropdown/Dropdown.js b/packages/dnb-ui-lib/src/components/dropdown/Dropdown.js index 9ff9973e29b..97fb4e29e61 100644 --- a/packages/dnb-ui-lib/src/components/dropdown/Dropdown.js +++ b/packages/dnb-ui-lib/src/components/dropdown/Dropdown.js @@ -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)