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

Enforce repeater has minChildren nodes in schema #342

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

Fweddi
Copy link
Contributor

@Fweddi Fweddi commented Feb 5, 2024

Worked on with @rhystmills.

This fixes a bug where you can 'delete' an element that requires one child, putting it in a broken state.

How to test

Publish the ProseMirror library locally and test in a consumer (e.g. Composer) where there is a repeater element with a minChildren property ≥ 1 (e.g. Key Takeaways).

You should be able to delete the element (by hitting CMD + A and backspace, not the controls as these are disabled).

Deleting the element will wipe all its content but crucially keep a repeater with one empty child.

The document should save as normal and fire no error messages.

@Fweddi Fweddi requested a review from a team as a code owner February 5, 2024 16:00
This fixes a bug where you can 'delete' an element that requires one child, putting it in a broken state

Co-authored-by: Rhys Mills <34686302+rhystmills@users.noreply.github.com>
@Fweddi Fweddi force-pushed the fp/rm/fix-repeater-schema-constraints branch from 01ce2dc to 2f56805 Compare February 5, 2024 16:12
@Fweddi Fweddi merged commit be51732 into main Feb 5, 2024
3 checks passed
@Fweddi Fweddi deleted the fp/rm/fix-repeater-schema-constraints branch February 5, 2024 16:17
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.

None yet

2 participants