Skip to content

Commit

Permalink
Determine if the node is a dom object
Browse files Browse the repository at this point in the history
  • Loading branch information
cnyballk committed Aug 30, 2018
1 parent 12a0847 commit 22d4b87
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 22d4b87

Please sign in to comment.