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

Collab: Fix basic handling of nested lists #112

Merged
merged 4 commits into from
Feb 25, 2022
Merged

Conversation

mirka
Copy link
Member

@mirka mirka commented Feb 25, 2022

Nested lists were throwing errors and failing to sync correctly:

TypeError: Cannot destructure property 'tagName' of 'formatType' as it is undefined.

This is a nested list

  • foo
    • bar
      • baz

The basic issue has been addressed in this PR. Truly concurrent editing of nested lists hasn't been handled yet (#113), so if two people type in a list with nested items at the same time, things will be wonky.

To test

  1. yarn storybook
  2. Open http://localhost:6006/?path=/story/collaboration--default in two browser tabs.
  3. Nested lists, both ul and ol, should sync correctly to the other tab with no console errors.

This doesn't actually fix anything, but adds a fallback layer of safety when unexpected things happen.
@mirka mirka added bug Something isn't working [Feature] Collaboration Real-time collaborative editing labels Feb 25, 2022
@mirka mirka requested a review from a team February 25, 2022 11:33
@mirka mirka self-assigned this Feb 25, 2022
@mirka mirka requested a review from naxoc February 25, 2022 11:33
@johngodley
Copy link
Member

Works great, thanks for the quick fix! I'll merge this and make a release

@johngodley johngodley merged commit ecd6e32 into trunk Feb 25, 2022
@johngodley johngodley deleted the collab/fix-nested-list branch February 25, 2022 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working [Feature] Collaboration Real-time collaborative editing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants