@snapdragonsnursery/react-components 1.1.7 → 1.1.9
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 +47 -12
package/package.json
CHANGED
package/src/ChildSearchModal.jsx
CHANGED
|
@@ -98,14 +98,22 @@ const ChildSearchModal = ({
|
|
|
98
98
|
if (isOpen && modalRef.current) {
|
|
99
99
|
const modal = modalRef.current;
|
|
100
100
|
const rect = modal.getBoundingClientRect();
|
|
101
|
+
const viewportHeight = window.innerHeight;
|
|
102
|
+
const expectedHeight = viewportHeight * 0.9;
|
|
103
|
+
const expectedContentHeight = expectedHeight - 300;
|
|
104
|
+
|
|
101
105
|
console.log('🔍 Modal Debug:', {
|
|
102
106
|
modalHeight: rect.height,
|
|
103
107
|
modalTop: rect.top,
|
|
104
108
|
modalBottom: rect.bottom,
|
|
105
|
-
viewportHeight:
|
|
109
|
+
viewportHeight: viewportHeight,
|
|
110
|
+
expectedHeight: expectedHeight,
|
|
111
|
+
expectedContentHeight: expectedContentHeight,
|
|
106
112
|
childrenCount: children.length,
|
|
107
113
|
loading,
|
|
108
|
-
error
|
|
114
|
+
error,
|
|
115
|
+
modalStyle: modal.style,
|
|
116
|
+
modalComputedStyle: window.getComputedStyle(modal)
|
|
109
117
|
});
|
|
110
118
|
|
|
111
119
|
// Check if modal is overflowing
|
|
@@ -342,7 +350,14 @@ const ChildSearchModal = ({
|
|
|
342
350
|
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4 overflow-hidden">
|
|
343
351
|
<div
|
|
344
352
|
ref={modalRef}
|
|
345
|
-
className={`bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-4xl w-full
|
|
353
|
+
className={`bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-4xl w-full flex flex-col overflow-hidden ${className}`}
|
|
354
|
+
style={{
|
|
355
|
+
maxHeight: '90vh',
|
|
356
|
+
height: '90vh',
|
|
357
|
+
display: 'flex',
|
|
358
|
+
flexDirection: 'column',
|
|
359
|
+
position: 'relative'
|
|
360
|
+
}}
|
|
346
361
|
>
|
|
347
362
|
{/* Header */}
|
|
348
363
|
<div className="flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700">
|
|
@@ -640,20 +655,30 @@ const ChildSearchModal = ({
|
|
|
640
655
|
|
|
641
656
|
{/* Content */}
|
|
642
657
|
<div
|
|
643
|
-
className="
|
|
644
|
-
style={{
|
|
658
|
+
className="overflow-hidden"
|
|
659
|
+
style={{
|
|
660
|
+
height: 'calc(90vh - 300px)',
|
|
661
|
+
maxHeight: 'calc(90vh - 300px)',
|
|
662
|
+
overflow: 'hidden',
|
|
663
|
+
flex: 'none',
|
|
664
|
+
position: 'relative'
|
|
665
|
+
}}
|
|
645
666
|
ref={(el) => {
|
|
646
667
|
if (el) {
|
|
647
668
|
const rect = el.getBoundingClientRect();
|
|
669
|
+
const computedStyle = window.getComputedStyle(el);
|
|
648
670
|
console.log('📦 Content Area Debug:', {
|
|
649
671
|
contentHeight: rect.height,
|
|
650
672
|
contentTop: rect.top,
|
|
651
673
|
contentBottom: rect.bottom,
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
674
|
+
flexGrow: computedStyle.flexGrow,
|
|
675
|
+
flexShrink: computedStyle.flexShrink,
|
|
676
|
+
minHeight: computedStyle.minHeight,
|
|
677
|
+
maxHeight: computedStyle.maxHeight,
|
|
678
|
+
height: computedStyle.height,
|
|
679
|
+
overflow: computedStyle.overflow,
|
|
680
|
+
styleMaxHeight: el.style.maxHeight,
|
|
681
|
+
styleHeight: el.style.height
|
|
657
682
|
});
|
|
658
683
|
}
|
|
659
684
|
}}
|
|
@@ -675,17 +700,27 @@ const ChildSearchModal = ({
|
|
|
675
700
|
{!loading && !error && (
|
|
676
701
|
<div
|
|
677
702
|
className="overflow-y-auto h-full max-h-full"
|
|
678
|
-
style={{
|
|
703
|
+
style={{
|
|
704
|
+
maxHeight: '100% !important',
|
|
705
|
+
height: '100% !important',
|
|
706
|
+
overflowY: 'auto !important'
|
|
707
|
+
}}
|
|
679
708
|
ref={(el) => {
|
|
680
709
|
if (el) {
|
|
681
710
|
const rect = el.getBoundingClientRect();
|
|
711
|
+
const computedStyle = window.getComputedStyle(el);
|
|
682
712
|
console.log('📜 Scrollable Content Debug:', {
|
|
683
713
|
scrollHeight: el.scrollHeight,
|
|
684
714
|
clientHeight: el.clientHeight,
|
|
685
715
|
scrollTop: el.scrollTop,
|
|
686
716
|
contentHeight: rect.height,
|
|
687
717
|
hasOverflow: el.scrollHeight > el.clientHeight,
|
|
688
|
-
parentHeight: el.parentElement?.offsetHeight
|
|
718
|
+
parentHeight: el.parentElement?.offsetHeight,
|
|
719
|
+
maxHeight: computedStyle.maxHeight,
|
|
720
|
+
height: computedStyle.height,
|
|
721
|
+
overflowY: computedStyle.overflowY,
|
|
722
|
+
styleMaxHeight: el.style.maxHeight,
|
|
723
|
+
styleHeight: el.style.height
|
|
689
724
|
});
|
|
690
725
|
}
|
|
691
726
|
}}
|