@snapdragonsnursery/react-components 1.1.4 → 1.1.6
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/package.json +1 -1
- package/src/ChildSearchModal.jsx +58 -3
package/package.json
CHANGED
package/src/ChildSearchModal.jsx
CHANGED
|
@@ -93,6 +93,31 @@ const ChildSearchModal = ({
|
|
|
93
93
|
};
|
|
94
94
|
}, [isOpen, onClose]);
|
|
95
95
|
|
|
96
|
+
// Debug modal dimensions
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (isOpen && modalRef.current) {
|
|
99
|
+
const modal = modalRef.current;
|
|
100
|
+
const rect = modal.getBoundingClientRect();
|
|
101
|
+
console.log('🔍 Modal Debug:', {
|
|
102
|
+
modalHeight: rect.height,
|
|
103
|
+
modalTop: rect.top,
|
|
104
|
+
modalBottom: rect.bottom,
|
|
105
|
+
viewportHeight: window.innerHeight,
|
|
106
|
+
childrenCount: children.length,
|
|
107
|
+
loading,
|
|
108
|
+
error
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Check if modal is overflowing
|
|
112
|
+
if (rect.bottom > window.innerHeight) {
|
|
113
|
+
console.warn('⚠️ Modal is overflowing bottom of viewport!');
|
|
114
|
+
}
|
|
115
|
+
if (rect.top < 0) {
|
|
116
|
+
console.warn('⚠️ Modal is overflowing top of viewport!');
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}, [isOpen, children.length, loading, error]);
|
|
120
|
+
|
|
96
121
|
// Search children
|
|
97
122
|
const searchChildren = useCallback(async () => {
|
|
98
123
|
if (!instance || !accounts[0]) {
|
|
@@ -317,7 +342,7 @@ const ChildSearchModal = ({
|
|
|
317
342
|
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4 overflow-hidden">
|
|
318
343
|
<div
|
|
319
344
|
ref={modalRef}
|
|
320
|
-
className={`bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-4xl w-full h-[90vh] flex flex-col ${className}`}
|
|
345
|
+
className={`bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-4xl w-full h-[90vh] flex flex-col overflow-hidden ${className}`}
|
|
321
346
|
>
|
|
322
347
|
{/* Header */}
|
|
323
348
|
<div className="flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700">
|
|
@@ -614,7 +639,23 @@ const ChildSearchModal = ({
|
|
|
614
639
|
</div>
|
|
615
640
|
|
|
616
641
|
{/* Content */}
|
|
617
|
-
<div
|
|
642
|
+
<div
|
|
643
|
+
className="flex-1 overflow-hidden min-h-0"
|
|
644
|
+
ref={(el) => {
|
|
645
|
+
if (el) {
|
|
646
|
+
const rect = el.getBoundingClientRect();
|
|
647
|
+
console.log('📦 Content Area Debug:', {
|
|
648
|
+
contentHeight: rect.height,
|
|
649
|
+
contentTop: rect.top,
|
|
650
|
+
contentBottom: rect.bottom,
|
|
651
|
+
computedStyle: window.getComputedStyle(el),
|
|
652
|
+
flexGrow: window.getComputedStyle(el).flexGrow,
|
|
653
|
+
flexShrink: window.getComputedStyle(el).flexShrink,
|
|
654
|
+
minHeight: window.getComputedStyle(el).minHeight
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
}}
|
|
658
|
+
>
|
|
618
659
|
{loading && (
|
|
619
660
|
<div className="flex items-center justify-center p-8">
|
|
620
661
|
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"></div>
|
|
@@ -630,7 +671,21 @@ const ChildSearchModal = ({
|
|
|
630
671
|
)}
|
|
631
672
|
|
|
632
673
|
{!loading && !error && (
|
|
633
|
-
<div
|
|
674
|
+
<div
|
|
675
|
+
className="overflow-y-auto h-full max-h-full"
|
|
676
|
+
ref={(el) => {
|
|
677
|
+
if (el) {
|
|
678
|
+
const rect = el.getBoundingClientRect();
|
|
679
|
+
console.log('📜 Scrollable Content Debug:', {
|
|
680
|
+
scrollHeight: el.scrollHeight,
|
|
681
|
+
clientHeight: el.clientHeight,
|
|
682
|
+
scrollTop: el.scrollTop,
|
|
683
|
+
contentHeight: rect.height,
|
|
684
|
+
hasOverflow: el.scrollHeight > el.clientHeight
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
}}
|
|
688
|
+
>
|
|
634
689
|
{children.length === 0 ? (
|
|
635
690
|
<div className="p-6 text-center text-gray-500 dark:text-gray-400">
|
|
636
691
|
{debouncedSearchTerm
|