From 6ed4fef78ca08f3cdffd9f4203c00a448b5640dc Mon Sep 17 00:00:00 2001 From: Polina Date: Fri, 13 Feb 2026 18:14:14 +0000 Subject: [PATCH] add evaluating jf initial swiper slide in diagram types (#976) Co-authored-by: Polina Co-committed-by: Polina --- .../mobile/src/view/edit/EditChart.jsx | 10 +++++++++- .../mobile/src/view/edit/EditChart.jsx | 12 ++++++++++-- .../mobile/src/view/edit/EditChart.jsx | 10 +++++++++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/mobile/src/view/edit/EditChart.jsx b/apps/documenteditor/mobile/src/view/edit/EditChart.jsx index 2b248c3cf8..abae98c472 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditChart.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditChart.jsx @@ -177,6 +177,14 @@ const PageChartType = props => { const chartProperties = storeFocusObjects.chartObject && storeFocusObjects.chartObject.get_ChartProperties(); const curType = chartProperties && chartProperties.getType(); + let initialSlide = 0; + if (curType !== undefined && types && types.length) { + const rowIndex = types.findIndex(row => row.some(item => item.type === curType)); + if (rowIndex >= 0) { + initialSlide = Math.min(Math.floor(rowIndex / countTypesSlide), countSlides - 1); + } + } + return ( @@ -184,7 +192,7 @@ const PageChartType = props => {
{types && types.length ? ( - + {arraySlides.map((_, indexSlide) => { let typesSlide = types.slice(indexSlide * countTypesSlide, (indexSlide * countTypesSlide) + countTypesSlide); diff --git a/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx b/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx index 9391c89f5b..e1f61bb24b 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditChart.jsx @@ -184,7 +184,15 @@ const PageChartType = props => { const storeFocusObjects = props.storeFocusObjects; const chartProperties = storeFocusObjects.chartObject && storeFocusObjects.chartObject.get_ChartProperties(); const curType = chartProperties && chartProperties.getType(); - + + let initialSlide = 0; + if (curType !== undefined && types && types.length) { + const rowIndex = types.findIndex(row => row.some(item => item.type === curType)); + if (rowIndex >= 0) { + initialSlide = Math.min(Math.floor(rowIndex / countTypesSlide), countSlides - 1); + } + } + return ( @@ -192,7 +200,7 @@ const PageChartType = props => {
{types && types.length ? ( - + {arraySlides.map((_, indexSlide) => { let typesSlide = types.slice(indexSlide * countTypesSlide, (indexSlide * countTypesSlide) + countTypesSlide); diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx index 3ac89c82ab..cdcf6ff132 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditChart.jsx @@ -178,13 +178,21 @@ const PageChartType = props => { const chartProperties = storeFocusObjects.chartObject && storeFocusObjects.chartObject.get_ChartProperties(); const curType = chartProperties && chartProperties.getType(); + let initialSlide = 0; + if (curType !== undefined && types && types.length) { + const rowIndex = types.findIndex(row => row.some(item => item.type === curType)); + if (rowIndex >= 0) { + initialSlide = Math.min(Math.floor(rowIndex / countTypesSlide), countSlides - 1); + } + } + return (
{types && types.length ? ( - + {arraySlides.map((_, indexSlide) => { let typesSlide = types.slice(indexSlide * countTypesSlide, (indexSlide * countTypesSlide) + countTypesSlide);