getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.79k stars 1.53k forks source link

User Feedback widget does not re-activate scrolling after submission #12496

Closed porenes closed 1 month ago

porenes commented 1 month ago

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

8.9.2

Framework Version

NextJs 14

Link to Sentry event

No response

SDK Setup


  integrations: [
    Sentry.replayIntegration({
      // Additional Replay configuration goes in here, for example:
      maskAllText: true,
      blockAllMedia: true,
    }),
    Sentry.feedbackIntegration({
      // Additional SDK configuration goes in here, for example:
      colorScheme: 'system',
      triggerLabel: 'Feedback',
      submitButtonLabel: 'Send your feedback',
      showName: false,
      showEmail: false,
      messagePlaceholder: 'What could be improved?',
      formTitle: 'Make F4R better !',
      showBranding: false,
    }),
  ],

Steps to Reproduce

1-go on a page that has scrolling 2-report a feedback on said page - at that time scrolling is disabled to preserve sentry feedback widget 3-submit feedback

Expected Result

The page is scrollable again

Actual Result

the page is not scrollable. It does not reproduce if you cancel your feedback

AbhiPrasad commented 1 month ago

Fix released with https://github.com/getsentry/sentry-javascript/releases/tag/8.10.0!

porenes commented 1 month ago

Works like a charm thx :-)

cdgco commented 6 days ago

I'm experiencing the same thing on 8.19.0 with Vue, although I cannot scroll after submitting or cancelling. It appears that the body is being tagged with style="overflow: hidden;" which is not being removed on form close.

cdgco commented 5 days ago

@AbhiPrasad This appears to be an issue specifically with the createForm method, rather than the attachTo method. For attachTo, the form is constructed with overridden values for onFormClose and onFormSubmitted passed which trigger resetting the body overflow, but when using createForm / appendToDom, no overridden values are passed for close / success (see integration.ts:315 compared to integration.ts:232), so onFormClose and therefore dialog.close() are never called and style="overflow: hidden;" is never removed.

I'm wondering if the real issue is that the default options _options specify onFormClose and onFormSubmitted but these values appear to be undefined rather than a default value?

Switching to attachTo resolved the issue, but I believe this should be resolved in createForm as well.

c298lee commented 3 days ago

@cdgco Thanks for bringing this up and for the informative writeup! I wrote up a ticket for this here. Feel free to follow that ticket for updates