File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
packages/feedback/src/core Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -209,12 +209,24 @@ export const buildFeedbackIntegration = ({
209
209
logger . error ( '[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.' ) ;
210
210
}
211
211
212
- return modalIntegration . createDialog ( {
213
- options,
212
+ const dialog = modalIntegration . createDialog ( {
213
+ options : {
214
+ ...options ,
215
+ onFormClose : ( ) => {
216
+ dialog && dialog . close ( ) ;
217
+ options . onFormClose && options . onFormClose ( ) ;
218
+ } ,
219
+ onFormSubmitted : ( ) => {
220
+ dialog && dialog . close ( ) ;
221
+ options . onFormSubmitted && options . onFormSubmitted ( ) ;
222
+ } ,
223
+ } ,
214
224
screenshotIntegration : screenshotRequired ? screenshotIntegration : undefined ,
215
225
sendFeedback,
216
226
shadow : _createShadow ( options ) ,
217
227
} ) ;
228
+
229
+ return dialog ;
218
230
} ;
219
231
220
232
const _attachTo = ( el : Element | string , optionOverrides : OverrideFeedbackConfiguration = { } ) : Unsubscribe => {
@@ -233,10 +245,6 @@ export const buildFeedbackIntegration = ({
233
245
if ( ! dialog ) {
234
246
dialog = await _loadAndRenderDialog ( {
235
247
...mergedOptions ,
236
- onFormClose : ( ) => {
237
- dialog && dialog . close ( ) ;
238
- mergedOptions . onFormClose && mergedOptions . onFormClose ( ) ;
239
- } ,
240
248
onFormSubmitted : ( ) => {
241
249
dialog && dialog . removeFromDom ( ) ;
242
250
mergedOptions . onFormSubmitted && mergedOptions . onFormSubmitted ( ) ;
You can’t perform that action at this time.
0 commit comments