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

Small CodeBlock in Modal fixes #2225

Merged
merged 2 commits into from
Jul 22, 2024
Merged

Small CodeBlock in Modal fixes #2225

merged 2 commits into from
Jul 22, 2024

Conversation

laurakwhit
Copy link
Contributor

@laurakwhit laurakwhit commented Jul 22, 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. Haven't been able to reproduce, but did notice that this ⬇️ was being called twice on close in the signal confirmation modal.

This PR calls closeModal instead of handleCancel on close buttons in the Modal component, so that open is updated to false > triggerModal is called > then modal.close() is called and finally handleCancel is only called/dispatched once. This PR also adds a destroy() for the @codemirror editor view to the CodeBlock component unmount.

Screenshots (if applicable) 📸

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

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

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

Copy link

vercel bot commented Jul 22, 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 22, 2024 7:04pm

@laurakwhit laurakwhit merged commit 88eeac1 into main Jul 22, 2024
14 checks passed
@laurakwhit laurakwhit deleted the codeblock-in-modal-fix branch July 22, 2024 21:24
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