Skip to content
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();
mergedOptions.onFormClose && mergedOptions.onFormClose();
},
onFormSubmitted: () => {
Expand Down