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: detect empty Rich Text fields using @prismicio/helpers's isFilled.richText() #130

Merged
merged 1 commit into from
Mar 3, 2022

Conversation

angeloashmore
Copy link
Member

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This PR correctly handles all types of empty Rich Text fields when using <PrismicRichText> and <PrismicText>. It uses @prismicio/helpers's isFilled.richText() helper internally.

This PR was done specifically to fix an unhandled case where a Rich Text field could contain a single empty paragraph block. This is treated as empty when using isFilled.richText(), but it was not handled properly in @prismicio/react before this PR.

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

🐕‍🦺

@github-actions
Copy link

github-actions bot commented Mar 2, 2022

size-limit report 📦

Path Size
dist/index.js 4.38 KB (+6.74% 🔺)
dist/index.cjs 6.27 KB (+0.46% 🔺)

@angeloashmore angeloashmore merged commit fc0d68c into master Mar 3, 2022
@angeloashmore angeloashmore deleted the aa/isFilled branch March 3, 2022 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant