Commit 782ad014 by t0ng7u

馃悰 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
parent 7d3bf7c5
...@@ -135,7 +135,7 @@ const ModelSelectModal = ({ visible, models = [], selected = [], onConfirm, onCa ...@@ -135,7 +135,7 @@ const ModelSelectModal = ({ visible, models = [], selected = [], onConfirm, onCa
const allActiveKeys = categoryEntries.map((_, index) => `${categoryKeyPrefix}_${index}`); const allActiveKeys = categoryEntries.map((_, index) => `${categoryKeyPrefix}_${index}`);
return ( return (
<Collapse activeKey={allActiveKeys}> <Collapse key={`${categoryKeyPrefix}_${categoryEntries.length}`} defaultActiveKey={[]}>
{categoryEntries.map(([key, categoryData], index) => ( {categoryEntries.map(([key, categoryData], index) => (
<Collapse.Panel <Collapse.Panel
key={`${categoryKeyPrefix}_${index}`} key={`${categoryKeyPrefix}_${index}`}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment