File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 11describe ( 'with allow-space prop' , ( ) => {
22 it ( 'shows suggestions after typing mention containing space' , ( ) => {
33 cy . visit ( '/allow-space' )
4- cy . get ( '.input' ) . type ( 'abc @space ' )
4+ cy . get ( '.input' ) . type ( 'abc @space in ' )
55 cy . get ( '.v-popper__popper' ) . should ( 'be.visible' )
66 . should ( 'contain' , 'space invader' )
7+ cy . get ( '.input' ) . type ( '{enter}' )
8+ cy . get ( '.preview' ) . should ( 'contain' , '@space invader' )
79 } )
810} )
Original file line number Diff line number Diff line change @@ -267,8 +267,9 @@ export default defineComponent({
267267 if (! (keyIndex < 1 || / \s / .test (getValue ()[keyIndex - 1 ]))) {
268268 return false
269269 }
270- const indexAtKey = props .allowSpace ? getValue ()[index - 1 ] === key : true
271- if (text != null && indexAtKey ) {
270+ const keyIsBeforeCaret = getValue ()[index - 1 ] === key
271+ const shouldOpen = props .allowSpace ? isMentioning .value || keyIsBeforeCaret : true
272+ if (text != null && shouldOpen ) {
272273 openMenu (key , keyIndex )
273274 searchText .value = text
274275 return true
You can’t perform that action at this time.
0 commit comments