Skip to content

Commit 689cc20

Browse files
authored
fix(gpt): added onClose props in plugin for markup mode (#669)
1 parent 5aa19ff commit 689cc20

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

demo/stories/gpt/gptWidgetOptions.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export const gptWidgetProps = (
5858
onTryAgain: async ({markup, customPrompt, promptData}) => {
5959
return gptRequestHandler({markup, customPrompt, promptData});
6060
},
61+
onClose: () => {
62+
console.log('close');
63+
},
6164
onLike: async () => {},
6265
onDislike: async () => {},
6366
onApplyResult: (markup) => {

src/extensions/additional/GPT/MarkupGpt/plugin.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ export function mGptPlugin<
135135
return renderPopup(this._anchor as HTMLElement, {
136136
...gptProps,
137137
disablePromptPresets: this.disablePromptPresets,
138-
onClose: () => hideMarkupGpt(this._view),
138+
onClose: () => {
139+
hideMarkupGpt(this._view);
140+
141+
gptProps.onClose?.();
142+
},
139143
markup: this.markup,
140144
onApplyResult: (changedMarkup) => this._onApplyResult(changedMarkup),
141145
});

0 commit comments

Comments
 (0)