mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-24 16:42:15 +00:00
FIX: Post helper menu results should be selectable (#1221)
This update fixes an issue where the results of the post helper menu was not selectable. Previously, selecting any text inside the menu was immediately closing the menu.
This commit is contained in:
parent
a6b08270c0
commit
371146cdfe
@ -13,6 +13,7 @@ import FastEditModal from "discourse/components/modal/fast-edit";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import { bind } from "discourse/lib/decorators";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import { sanitize } from "discourse/lib/text";
|
||||
import { clipboardCopy } from "discourse/lib/utilities";
|
||||
import { i18n } from "discourse-i18n";
|
||||
@ -69,6 +70,23 @@ export default class AiPostHelperMenu extends Component {
|
||||
|
||||
@tracked _activeAiRequest = null;
|
||||
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
|
||||
withPluginApi((api) => {
|
||||
api.registerValueTransformer(
|
||||
"post-text-selection-prevent-close",
|
||||
({ value }) => {
|
||||
if (this.menuState === this.MENU_STATES.result) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
get footnoteDisabled() {
|
||||
return this.streaming || !this.supportsAddFootnote;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user