Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/schedule-and-details/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ const ScheduleAndDetails = ({ courseId }) => {
license,
language,
subtitle,
overview,
duration,
selfPaced,
startDate,
Expand All @@ -128,7 +127,6 @@ const ScheduleAndDetails = ({ courseId }) => {
instructorInfo,
enrollmentStart,
shortDescription,
aboutSidebarHtml,
preRequisiteCourses,
entranceExamEnabled,
courseImageAssetPath,
Expand All @@ -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
Expand Down Expand Up @@ -277,12 +281,12 @@ const ScheduleAndDetails = ({ courseId }) => {
)}
<IntroducingSection
title={title}
overview={overview}
overview={initialOverview}
duration={duration}
subtitle={subtitle}
introVideo={introVideo}
description={description}
aboutSidebarHtml={aboutSidebarHtml}
aboutSidebarHtml={initialAboutSidebarHtml}
shortDescription={shortDescription}
aboutPageEditable={aboutPageEditable}
sidebarHtmlEnabled={sidebarHtmlEnabled}
Expand Down