fix: Correct text direction in Course Overview field#2437
fix: Correct text direction in Course Overview field#2437Lunyachek wants to merge 3 commits intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @Lunyachek! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2437 +/- ##
========================================
Coverage 94.64% 94.64%
========================================
Files 1187 1187
Lines 26220 26222 +2
Branches 5679 5821 +142
========================================
+ Hits 24817 24819 +2
+ Misses 1344 1333 -11
- Partials 59 70 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| <WysiwygEditor | ||
| initialValue={overview} | ||
| value={overview} | ||
| onChange={(value) => onChange(value, 'overview')} | ||
| /> |
There was a problem hiding this comment.
I tested on my local and the typing direction issue was fixed, but it adds a different issue: the editor does not show the initial value even the passed data on the value param is set.
The docs indicate that the initualValue should not be modified by the onChange so by doing the next we can fix the issue and keep the initialValue:
const [initialOverview] = React.useState(overview);
<WysiwygEditor
initialValue={initialOverview}
value={overview}
onChange={(value) => onChange(value, 'overview')}
/>
There was a problem hiding this comment.
Thanks for the feedback! You were right, I fixed initialValue with useState and added separate variables for both overview and aboutSidebarHtml, so the editors now correctly display their initial values.
There was a problem hiding this comment.
Thanks for addressing it!
| <Form.Group className="form-group-custom"> | ||
| <Form.Label>{intl.formatMessage(messages.courseAboutSidebarLabel)}</Form.Label> | ||
| <WysiwygEditor | ||
| initialValue={aboutSidebarHtml} |
There was a problem hiding this comment.
The same applies here.
|
The check is failing because the last commit is not following the commit convention, can you please edit it? |
a9705ce to
db663c2
Compare
Fixed |
|
@bradenmacdonald Hello! I've created a new course and I can see the initial value for the Course Overview field. Or did I misunderstand what you meant? 2025-09-22.10.56.57.mov |
|
@Lunyachek Yep, that's it. It seems to be working for you, but not for me. I put an explanation of what I think the bug is above, and it could result in a flaky bug that sometimes happens and sometimes doesn't. Or otherwise there is something wrong with my environment. Maybe you can rebase the PR and we can both try again? If you also log the value of |
|
@bradenmacdonald Here are my logs from running the component locally: On init/mount, initialOverview is indeed empty (''), since it takes the snapshot before the async overview data arrives. When overview is later passed down with the real HTML, initialOverview !== overview (as expected, because useState keeps the first snapshot). The WysiwygEditor still receives the correct value prop with the loaded HTML. So on my side the behavior is stable — the editor initializes and then updates correctly once overview is populated. I rebased and temporarily pushed my logs to this PR (I'll delete them later) |
db663c2 to
79cb2b4
Compare
|
Thanks for pushing those logs @Lunyachek. Here's what I see:
Whereas here's what it looked like before this PR (the text direction is wrong, but the content does appear):
|
| initialValue={overview} | ||
| onChange={(value) => onChange(value, 'overview')} | ||
| initialValue={initialOverview} | ||
| value={overview} |
There was a problem hiding this comment.
This seems wrong - as far as I can tell (and TypeScript can tell), WysiwygEditor does not accept a value prop.
|
I still think the problem is If Notice that on your system we see these logs: So the value of But on mine we see: So the value of Sometimes the bug is gone, for example if I hot-reload just the |
|
I could not reproduce @bradenmacdonald's problem neither but I think something like this may solve it, give it a try on your env @Lunyachek. <IntroducingSection
overview={loadingDetailsStatus !== RequestStatus.LOADING ? courseDetails.overview ?? '' : null} |
|
Alternate fix is proposed at #2599 but I haven't reviewed it yet. |
|
I'm going to close this for now as the alternative fix in #2599 is working more reliably for me. Let me know if anyone sees any issues with it. |
|
Thanks, everyone! Great fix: #2599 |





Description
In Course Overview field we can see incorrect text typing direction
Screen.Recording.2025-09-08.at.16.30.55.mov
Fix was found in tinymce-react issues section - tinymce/tinymce-react#267