use-carousel-hook
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -26,2 +26,6 @@ "use strict"; | ||
const children = [...el.children]; | ||
// If scrollWidth or scrollHeight is 0, return the children length | ||
if ((options.direction === 'vertical' && el.scrollHeight === 0) || el.scrollWidth === 0) { | ||
return children.length; | ||
} | ||
const lastScrollableChild = children.findIndex(child => options.direction === 'vertical' | ||
@@ -28,0 +32,0 @@ ? child.offsetTop >= el.scrollHeight - el.offsetHeight |
@@ -21,2 +21,6 @@ import { useState, useRef, useEffect, useReducer, useCallback } from 'react'; | ||
const children = [...el.children]; | ||
// If scrollWidth or scrollHeight is 0, return the children length | ||
if ((options.direction === 'vertical' && el.scrollHeight === 0) || el.scrollWidth === 0) { | ||
return children.length; | ||
} | ||
const lastScrollableChild = children.findIndex(child => options.direction === 'vertical' | ||
@@ -23,0 +27,0 @@ ? child.offsetTop >= el.scrollHeight - el.offsetHeight |
{ | ||
"name": "use-carousel-hook", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "Adds functionality for carousels using React hooks", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29178
623