Skip to content

Commit 2596e6e

Browse files
fix(vue) SearchBox - handle enter keypress for trigger mdoe
1 parent e64e4a7 commit 2596e6e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/vue/src/components/search/SearchBox.jsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,10 +815,20 @@ const SearchBox = defineComponent({
815815
true,
816816
this.$props,
817817
this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined, // to handle tags
818-
!this.$props.enableAI,
818+
!(
819+
this.$props.enableAI
820+
&& this.currentTriggerMode === AI_TRIGGER_MODES.QUESTION
821+
&& event.target.value.endsWith('?')
822+
),
819823
);
820-
if (this.$props.enableAI && !this.showAIScreen) {
824+
if (
825+
this.$props.enableAI
826+
&& !this.showAIScreen
827+
&& this.currentTriggerMode === AI_TRIGGER_MODES.QUESTION
828+
&& event.target.value.endsWith('?')
829+
) {
821830
this.showAIScreen = true;
831+
this.isOpen = true;
822832
}
823833
this.onValueSelectedHandler(event.target.value, causes.ENTER_PRESS);
824834
}

0 commit comments

Comments
 (0)