🐛 fix: make ModelSelectModal panels collapsible and default to collapsed
- Switch Collapse from controlled (activeKey) to uncontrolled (defaultActiveKey) so user toggling works - Add a stable key to reset Collapse state when tab/category changes - Default all panels to collapsed via defaultActiveKey: [] - Preserve Panel itemKey for consistent behavior - No linter errors introduced Scope: web/src/components/table/channels/modals/ModelSelectModal.jsx
This commit is contained in:
@@ -135,7 +135,7 @@ const ModelSelectModal = ({ visible, models = [], selected = [], onConfirm, onCa
|
||||
const allActiveKeys = categoryEntries.map((_, index) => `${categoryKeyPrefix}_${index}`);
|
||||
|
||||
return (
|
||||
<Collapse activeKey={allActiveKeys}>
|
||||
<Collapse key={`${categoryKeyPrefix}_${categoryEntries.length}`} defaultActiveKey={[]}>
|
||||
{categoryEntries.map(([key, categoryData], index) => (
|
||||
<Collapse.Panel
|
||||
key={`${categoryKeyPrefix}_${index}`}
|
||||
|
||||
Reference in New Issue
Block a user