Skip to content

Commit

Permalink
fix: scrollable node is not scrollable in some situations (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 authored and benjycui committed Aug 23, 2017
1 parent 47b09bf commit 759f8da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/createDOMForm.js
Expand Up @@ -37,7 +37,9 @@ function getScrollableContainer(n) {
/* eslint no-cond-assign:0 */
while ((nodeName = node.nodeName.toLowerCase()) !== 'body') {
const overflowY = computedStyle(node, 'overflowY');
if (node !== n && (overflowY === 'auto' || overflowY === 'scroll')) {
// https://stackoverflow.com/a/36900407/3040605
if (node !== n && (overflowY === 'auto' || overflowY === 'scroll') &&
node.scrollHeight > node.clientHeight) {
return node;
}
node = node.parentNode;
Expand Down

0 comments on commit 759f8da

Please sign in to comment.