Commit ca3053f
fix: resolve MCP service modal checkbox double-click event issue (#5790)
Fixed the issue where clicking on checkboxes in the MCP service modal
would trigger double-click events, causing selections to be immediately
deselected.
Root cause:
- Checkbox onChange events were conflicting with parent HStack onClick events
- Both components were trying to handle the same selection logic
Solution:
- Extracted handleItemClick function to avoid code duplication
- Flex onClick: only e.stopPropagation() to prevent event bubbling
- Checkbox onChange: handleItemClick for checkbox-specific interactions
- HStack onClick: handleItemClick for row-level interactions
Benefits:
✅ Checkbox clicks work properly without double-toggle
✅ Full row click functionality preserved
✅ All checkbox hover/focus effects maintained
✅ Clean DRY code structure with shared logic
✅ Perfect visual alignment between checkbox and avatar
Changes made to:
- projects/app/src/pageComponents/dashboard/mcp/EditModal.tsx:159-194
🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Happy <yesreply@happy.engineering>1 parent 703ef2c commit ca3053f
File tree
1 file changed
+27
-20
lines changed- projects/app/src/pageComponents/dashboard/mcp
1 file changed
+27
-20
lines changedLines changed: 27 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
159 | 178 | | |
160 | 179 | | |
161 | 180 | | |
| |||
166 | 185 | | |
167 | 186 | | |
168 | 187 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 188 | + | |
187 | 189 | | |
188 | | - | |
189 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
190 | 197 | | |
191 | 198 | | |
192 | 199 | | |
| |||
0 commit comments