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
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions packages/feedback/src/core/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,24 @@ export const buildFeedbackIntegration = ({
logger.error('[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.');
}

return modalIntegration.createDialog({
options,
const dialog = modalIntegration.createDialog({
options: {
...options,
onFormClose: () => {
dialog && dialog.close();
options.onFormClose && options.onFormClose();
},
onFormSubmitted: () => {
dialog && dialog.close();
options.onFormSubmitted && options.onFormSubmitted();
},
},
screenshotIntegration: screenshotRequired ? screenshotIntegration : undefined,
sendFeedback,
shadow: _createShadow(options),
});

return dialog;
};

const _attachTo = (el: Element | string, optionOverrides: OverrideFeedbackConfiguration = {}): Unsubscribe => {
Expand All @@ -234,7 +246,7 @@ export const buildFeedbackIntegration = ({
dialog = await _loadAndRenderDialog({
...mergedOptions,
onFormClose: () => {
dialog && dialog.close();
dialog && dialog.removeFromDom();
spalmurray-codecov marked this conversation as resolved.
Show resolved Hide resolved
mergedOptions.onFormClose && mergedOptions.onFormClose();
},
onFormSubmitted: () => {
Expand Down
Loading