@qwanyx/carousel 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -1
- package/dist/index.mjs +5 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -893,6 +893,9 @@ var Carousel = (0, import_react4.forwardRef)(
|
|
|
893
893
|
(0, import_react4.useEffect)(() => {
|
|
894
894
|
if (!nav.keyboard) return;
|
|
895
895
|
const handleKeyDown = (e) => {
|
|
896
|
+
const target = e.target;
|
|
897
|
+
const isFormElement = target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.tagName === "SELECT" || target.isContentEditable;
|
|
898
|
+
if (isFormElement) return;
|
|
896
899
|
switch (e.key) {
|
|
897
900
|
case "ArrowRight":
|
|
898
901
|
case "ArrowDown":
|
|
@@ -1035,7 +1038,8 @@ var Carousel = (0, import_react4.forwardRef)(
|
|
|
1035
1038
|
opacity: transition === "fade" ? index === currentIndex ? 1 : 0 : 1,
|
|
1036
1039
|
transition: `opacity ${transitionDuration}ms ease-in-out`,
|
|
1037
1040
|
pointerEvents: index === currentIndex ? "auto" : "none",
|
|
1038
|
-
cursor: canEdit ? "pointer" : "default"
|
|
1041
|
+
cursor: canEdit ? "pointer" : "default",
|
|
1042
|
+
zIndex: index === currentIndex ? 1 : 0
|
|
1039
1043
|
},
|
|
1040
1044
|
onDoubleClick: () => handleSlideDoubleClick(index),
|
|
1041
1045
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SlideRenderer, { slide, isActive: index === currentIndex, slideIndex: index })
|
package/dist/index.mjs
CHANGED
|
@@ -858,6 +858,9 @@ var Carousel = forwardRef(
|
|
|
858
858
|
useEffect3(() => {
|
|
859
859
|
if (!nav.keyboard) return;
|
|
860
860
|
const handleKeyDown = (e) => {
|
|
861
|
+
const target = e.target;
|
|
862
|
+
const isFormElement = target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.tagName === "SELECT" || target.isContentEditable;
|
|
863
|
+
if (isFormElement) return;
|
|
861
864
|
switch (e.key) {
|
|
862
865
|
case "ArrowRight":
|
|
863
866
|
case "ArrowDown":
|
|
@@ -1000,7 +1003,8 @@ var Carousel = forwardRef(
|
|
|
1000
1003
|
opacity: transition === "fade" ? index === currentIndex ? 1 : 0 : 1,
|
|
1001
1004
|
transition: `opacity ${transitionDuration}ms ease-in-out`,
|
|
1002
1005
|
pointerEvents: index === currentIndex ? "auto" : "none",
|
|
1003
|
-
cursor: canEdit ? "pointer" : "default"
|
|
1006
|
+
cursor: canEdit ? "pointer" : "default",
|
|
1007
|
+
zIndex: index === currentIndex ? 1 : 0
|
|
1004
1008
|
},
|
|
1005
1009
|
onDoubleClick: () => handleSlideDoubleClick(index),
|
|
1006
1010
|
children: /* @__PURE__ */ jsx3(SlideRenderer, { slide, isActive: index === currentIndex, slideIndex: index })
|