mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 08:19:07 +00:00
Fix dz, and auto open repeatable compo
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
55b5fcc672
commit
a8eb79de6d
@ -56,6 +56,7 @@ const RepeatableComponent = ({
|
||||
}, [componentValueLength]);
|
||||
|
||||
const { collapses } = state.toJS();
|
||||
|
||||
const toggleCollapses = index => {
|
||||
dispatch({
|
||||
type: 'TOGGLE_COLLAPSE',
|
||||
@ -79,6 +80,7 @@ const RepeatableComponent = ({
|
||||
)}
|
||||
<div ref={drop}>
|
||||
{componentValueLength > 0 &&
|
||||
componentValueLength === collapses.length &&
|
||||
componentValue.map((data, index) => {
|
||||
const componentFieldName = `${name}.${index}`;
|
||||
const doesPreviousFieldContainErrorsAndIsOpen =
|
||||
|
@ -37,7 +37,7 @@ const reducer = (state, action) => {
|
||||
|
||||
const newCollapses = Array.from({ length: collapsesLength }).map((_, i) => {
|
||||
const shouldOpenLastCollapse = state.get('shouldOpenLastCollapse');
|
||||
const isOpen = shouldOpenLastCollapse && i === action.dataLength.length - 1;
|
||||
const isOpen = shouldOpenLastCollapse && i === action.dataLength - 1;
|
||||
|
||||
return {
|
||||
isOpen,
|
||||
|
Loading…
x
Reference in New Issue
Block a user