Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the richTextEditor output in case on no data save #19476

Merged
merged 3 commits into from
Jan 22, 2025

Conversation

Ashish8689
Copy link
Contributor

@Ashish8689 Ashish8689 commented Jan 22, 2025

Describe your changes:

Fixes

  • Issue : On any Description update, when data is being cleared and save it used to have empty <p></p> tag in the editor response.
  • I worked on fixing the richTextEditor output to be undefined in case of all data is cleared.

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Copy link
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 64%
64.65% (40875/63221) 40.89% (16420/40155) 44.11% (4969/11266)

Copy link

@Ashish8689 Ashish8689 marked this pull request as ready for review January 22, 2025 10:54
@Ashish8689 Ashish8689 requested a review from a team as a code owner January 22, 2025 10:54
@Ashish8689 Ashish8689 merged commit 06759c5 into main Jan 22, 2025
16 of 17 checks passed
@Ashish8689 Ashish8689 deleted the markdown-description branch January 22, 2025 13:35
Ashish8689 added a commit that referenced this pull request Jan 22, 2025
* fix the richTextEditor output in case on no data save

* revert the undefined to empty string as we previously had

(cherry picked from commit 06759c5)
@@ -47,7 +47,7 @@ const RichTextEditor = forwardRef<EditorContentRef, RichTextEditorProp>(
const htmlContent = editorRef.current?.editor?.getHTML() ?? '';
const backendFormat = formatContent(htmlContent, 'server');

return backendFormat;
return backendFormat === '<p></p>' ? '' : backendFormat;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel we can control this inside formatContent itself instead having condition on component end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test Add this label to run secure Github workflows on PRs UI UI specific issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants