From b265b170ec94aaf80f3306039e004ede5b2c76f6 Mon Sep 17 00:00:00 2001 From: Muhammad Arslan Abdul Rauf Date: Mon, 3 Nov 2025 19:28:15 +0500 Subject: [PATCH] fix: seperate initialValue to not cause re-render on updates --- src/schedule-and-details/index.jsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/schedule-and-details/index.jsx b/src/schedule-and-details/index.jsx index dcb7adc368..e8ccdb9402 100644 --- a/src/schedule-and-details/index.jsx +++ b/src/schedule-and-details/index.jsx @@ -117,7 +117,6 @@ const ScheduleAndDetails = ({ courseId }) => { license, language, subtitle, - overview, duration, selfPaced, startDate, @@ -128,7 +127,6 @@ const ScheduleAndDetails = ({ courseId }) => { instructorInfo, enrollmentStart, shortDescription, - aboutSidebarHtml, preRequisiteCourses, entranceExamEnabled, courseImageAssetPath, @@ -140,6 +138,12 @@ const ScheduleAndDetails = ({ courseId }) => { } = editedValues; useScrollToHashElement({ isLoading }); + // No need to get overview and aboutSidebarHtml from editedValues + // As updating them re-renders TinyMCE + // Which causes issues with TinyMCE editor cursor position + // https://www.tiny.cloud/docs/tinymce/5/react/#initialvalue + const { overview: initialOverview } = courseDetails || {}; + const { aboutSidebarHtml: initialAboutSidebarHtml } = courseDetails || {}; if (isLoading) { // eslint-disable-next-line react/jsx-no-useless-fragment @@ -277,12 +281,12 @@ const ScheduleAndDetails = ({ courseId }) => { )}