Skip to content

Commit

Permalink
Merge pull request twobin#195 from cnyballk/master
Browse files Browse the repository at this point in the history
Determine if the node  is a dom object while finding parent html element
  • Loading branch information
ameerthehacker authored Aug 30, 2018
2 parents 12a0847 + 22d4b87 commit 6f20725
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const checkNormalVisible = function checkNormalVisible(component) {
*/
const checkVisible = function checkVisible(component) {
const node = ReactDom.findDOMNode(component);
if (!node) {
if (!(node instanceof HTMLElement)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/scrollParent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

export default (node) => {
if (!node) {
if (!(node instanceof HTMLElement)) {
return document.documentElement;
}

Expand Down

0 comments on commit 6f20725

Please sign in to comment.