mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 09:25:46 +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]);
|
}, [componentValueLength]);
|
||||||
|
|
||||||
const { collapses } = state.toJS();
|
const { collapses } = state.toJS();
|
||||||
|
|
||||||
const toggleCollapses = index => {
|
const toggleCollapses = index => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'TOGGLE_COLLAPSE',
|
type: 'TOGGLE_COLLAPSE',
|
||||||
@ -79,6 +80,7 @@ const RepeatableComponent = ({
|
|||||||
)}
|
)}
|
||||||
<div ref={drop}>
|
<div ref={drop}>
|
||||||
{componentValueLength > 0 &&
|
{componentValueLength > 0 &&
|
||||||
|
componentValueLength === collapses.length &&
|
||||||
componentValue.map((data, index) => {
|
componentValue.map((data, index) => {
|
||||||
const componentFieldName = `${name}.${index}`;
|
const componentFieldName = `${name}.${index}`;
|
||||||
const doesPreviousFieldContainErrorsAndIsOpen =
|
const doesPreviousFieldContainErrorsAndIsOpen =
|
||||||
|
@ -37,7 +37,7 @@ const reducer = (state, action) => {
|
|||||||
|
|
||||||
const newCollapses = Array.from({ length: collapsesLength }).map((_, i) => {
|
const newCollapses = Array.from({ length: collapsesLength }).map((_, i) => {
|
||||||
const shouldOpenLastCollapse = state.get('shouldOpenLastCollapse');
|
const shouldOpenLastCollapse = state.get('shouldOpenLastCollapse');
|
||||||
const isOpen = shouldOpenLastCollapse && i === action.dataLength.length - 1;
|
const isOpen = shouldOpenLastCollapse && i === action.dataLength - 1;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isOpen,
|
isOpen,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user