@snapdragonsnursery/react-components 1.1.5 → 1.1.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapdragonsnursery/react-components",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -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]) {
@@ -614,7 +639,25 @@ const ChildSearchModal = ({
614
639
  </div>
615
640
 
616
641
  {/* Content */}
617
- <div className="flex-1 overflow-hidden min-h-0">
642
+ <div
643
+ className="flex-1 overflow-hidden min-h-0 max-h-0"
644
+ style={{ maxHeight: 'calc(90vh - 200px)' }}
645
+ ref={(el) => {
646
+ if (el) {
647
+ const rect = el.getBoundingClientRect();
648
+ console.log('📦 Content Area Debug:', {
649
+ contentHeight: rect.height,
650
+ contentTop: rect.top,
651
+ contentBottom: rect.bottom,
652
+ computedStyle: window.getComputedStyle(el),
653
+ flexGrow: window.getComputedStyle(el).flexGrow,
654
+ flexShrink: window.getComputedStyle(el).flexShrink,
655
+ minHeight: window.getComputedStyle(el).minHeight,
656
+ maxHeight: window.getComputedStyle(el).maxHeight
657
+ });
658
+ }
659
+ }}
660
+ >
618
661
  {loading && (
619
662
  <div className="flex items-center justify-center p-8">
620
663
  <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"></div>
@@ -630,7 +673,23 @@ const ChildSearchModal = ({
630
673
  )}
631
674
 
632
675
  {!loading && !error && (
633
- <div className="overflow-y-auto h-full max-h-full">
676
+ <div
677
+ className="overflow-y-auto h-full max-h-full"
678
+ style={{ maxHeight: '100%' }}
679
+ ref={(el) => {
680
+ if (el) {
681
+ const rect = el.getBoundingClientRect();
682
+ console.log('📜 Scrollable Content Debug:', {
683
+ scrollHeight: el.scrollHeight,
684
+ clientHeight: el.clientHeight,
685
+ scrollTop: el.scrollTop,
686
+ contentHeight: rect.height,
687
+ hasOverflow: el.scrollHeight > el.clientHeight,
688
+ parentHeight: el.parentElement?.offsetHeight
689
+ });
690
+ }
691
+ }}
692
+ >
634
693
  {children.length === 0 ? (
635
694
  <div className="p-6 text-center text-gray-500 dark:text-gray-400">
636
695
  {debouncedSearchTerm