activateOnCompletion not work well

when i used completion.apply。I notice that activateOnCompletion didnt trigger。i read the source code and didnt fix it。here is my code:

completion config:

{
      label: xxx',
      boost: 10,
      apply: (view: EditorView, _: Completion, from: number, to: number) => {
        view.dispatch({
          changes: { from, to, insert: 'xxx' },
          selection: EditorSelection.cursor(from + 3),
          userEvent: 'input.complete',
        });
      },
    }

activateOnCompletion config:

activateOnCompletion: (completion: Completion) => {
          if (completion.label === 'xxx') return true;
          return false;
        },

Include the pickedCompletion effect in your transaction so that the system can recognize it as a completion event (as the docs for apply tell you also).

1 Like