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(feedback): Call dialog.close() in dialog close callbacks in _loadAndRenderDialog #13203

Merged

Conversation

spalmurray-codecov
Copy link
Contributor

@spalmurray-codecov spalmurray-codecov commented Aug 2, 2024

Updates _loadAndRenderDialog to call dialog.close() in the onFormClose and onFormSubmitted callbacks.

Motivation: over at Codecov, we're modifying our user feedback setup so that we have two different feedback integrations, one using the default widget with createWidget, and one that is triggered by a button in our help dropdown with createForm. After adding these we noticed what seems to be a bug where the createForm form does not clear the overflow: hidden style on the body when the modal is closed, while the createWidget form does clear this style. We currently have added a callback on our end that manually resets the overflow style, but I'm currently revisiting this code again and I thought why not see if we can fix it upstream here 🙂

Here's a gif of the issue:

Recording 2024-08-02 at 12 54 04

Digging into the code here, it seems that the createForm form is not getting a call to dialog.close() when the form is closed, unlike _attachTo does (link). To fix, I've pulled the dialog.close() call out into _loadAndRenderDialog.

Copy link
Contributor

github-actions bot commented Aug 2, 2024

size-limit report 📦

Path Size
@sentry/browser 22.46 KB (0%)
@sentry/browser (incl. Tracing) 34.24 KB (0%)
@sentry/browser (incl. Tracing, Replay) 70.29 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 63.63 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 74.69 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 87.29 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 89.13 KB (+0.02% 🔺)
@sentry/browser (incl. metrics) 26.77 KB (0%)
@sentry/browser (incl. Feedback) 39.39 KB (+0.03% 🔺)
@sentry/browser (incl. sendFeedback) 27.08 KB (0%)
@sentry/browser (incl. FeedbackAsync) 31.72 KB (+0.03% 🔺)
@sentry/react 25.23 KB (0%)
@sentry/react (incl. Tracing) 37.24 KB (0%)
@sentry/vue 26.61 KB (0%)
@sentry/vue (incl. Tracing) 36.07 KB (0%)
@sentry/svelte 22.59 KB (0%)
CDN Bundle 23.65 KB (0%)
CDN Bundle (incl. Tracing) 35.9 KB (0%)
CDN Bundle (incl. Tracing, Replay) 70.33 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 75.59 KB (+0.02% 🔺)
CDN Bundle - uncompressed 69.41 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 106.32 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 218.17 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 231.08 KB (+0.04% 🔺)
@sentry/nextjs (client) 37.09 KB (0%)
@sentry/sveltekit (client) 34.81 KB (0%)
@sentry/node 114.77 KB (+0.01% 🔺)
@sentry/node - without tracing 89.33 KB (+0.01% 🔺)
@sentry/aws-serverless 98.5 KB (+0.01% 🔺)

@spalmurray-codecov spalmurray-codecov marked this pull request as ready for review August 2, 2024 17:19
@spalmurray-codecov spalmurray-codecov requested a review from a team as a code owner August 2, 2024 17:19
@spalmurray-codecov spalmurray-codecov changed the title fix(feedback): Call dialog.close() in form close callbacks for createForm forms fix(feedback): Call dialog.close() in dialog close callbacks for createForm forms Aug 2, 2024
@c298lee
Copy link
Contributor

c298lee commented Aug 2, 2024

Ty for fixing this!!
Fixes #13046

@spalmurray-codecov spalmurray-codecov force-pushed the spalmurray/fix-manual-feedback-modal-close branch from d866011 to 841d57c Compare August 2, 2024 18:11
@spalmurray-codecov spalmurray-codecov changed the title fix(feedback): Call dialog.close() in dialog close callbacks for createForm forms fix(feedback): Call dialog.close() in dialog close callbacks in _loadAndRenderDialog Aug 2, 2024
@spalmurray-codecov spalmurray-codecov merged commit d996c22 into develop Aug 2, 2024
119 checks passed
@spalmurray-codecov spalmurray-codecov deleted the spalmurray/fix-manual-feedback-modal-close branch August 2, 2024 19:11
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.

3 participants