Skip to content

Commit

Permalink
dropdown component: fixes documentElement.scrollTop issue (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
ifrim authored Apr 1, 2021
1 parent c595025 commit c69509d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/tyk-ui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/tyk-ui.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tyk-technologies/tyk-ui",
"version": "2.1.9",
"version": "2.1.10",
"description": "Tyk UI - ui reusable components",
"main": "lib/index.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion src/form/components/Dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ export default class Dropdown extends Component {
return;
}

const { scrollTop } = document.documentElement;
const scrollTop = Math.max(
document.documentElement.scrollTop,
document.body.scrollTop,
window.scrollY,
);
const el = this.dropdownRef.current;
const elHeight = el.clientHeight;
const dropdownHeight = dropdownEl ? dropdownEl.clientHeight : 0;
Expand Down

0 comments on commit c69509d

Please sign in to comment.