Commit 583f231
committed
feat(CompactMap): add autoExpandOnCarouselClick prop for opt-in auto-expand
Adds explicit control over auto-expand behavior with a new prop.
New Prop:
- autoExpandOnCarouselClick: boolean (default: false)
- When true: clicking carousel card auto-expands to fullscreen
- When false: users must click expand button manually
Benefits:
- Backward compatible (default: false preserves existing behavior)
- Explicit opt-in for auto-expand UX
- Developers can choose based on their use case
- Doesn't force auto-expand on all CompactMap instances
Implementation:
- Added prop to CompactMapProps interface
- Wrapped carousel onLocationSelect to conditionally call onExpand
- Only triggers when prop is true AND location is selected AND onExpand exists
Usage:
<CompactMap
locations={locations}
onExpand={handleExpand}
autoExpandOnCarouselClick={true} // Opt-in
/>1 parent fd238fa commit 583f231
1 file changed
+18
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
| |||
76 | 84 | | |
77 | 85 | | |
78 | 86 | | |
| 87 | + | |
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
| |||
121 | 130 | | |
122 | 131 | | |
123 | 132 | | |
124 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
125 | 142 | | |
126 | 143 | | |
127 | 144 | | |
| |||
0 commit comments