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

Dispatch ChangeSet instead of creating new EditorState on resetView in CodeBlock component #2243

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

laurakwhit
Copy link
Contributor

@laurakwhit laurakwhit commented Jul 30, 2024

Description & motivation 💭

We're seeing the occasional RangeError: Invalid change range [num] to [num] (in doc of length [num]) error coming from @codemirror and it looks like it's happening for Codeblocks in Modal components. Specifically after this is called ⬇️

This PR dispatches a transaction with a ChangeSet in resetView on the CodeBlock component instead of creating a whole new EditorState and calling setState.

Screenshots (if applicable) 📸

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

  • On a Running workflow
    • select Send a Signal > fill out Name and Input > close the modal
    • select Send a Signal again
      • Verify Input has been cleared
    • fill out Name > tab to Input and fill out (this is where error was occurring)
      • Verify no error occurs and signal can be submitted successfully

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

@laurakwhit laurakwhit requested a review from rossedfort as a code owner July 30, 2024 21:38
Copy link

vercel bot commented Jul 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
holocene ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2024 9:38pm

@laurakwhit laurakwhit merged commit af0d545 into main Jul 30, 2024
14 checks passed
@laurakwhit laurakwhit deleted the fix-reset-codeblock branch July 30, 2024 23:12
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.

2 participants