Title
Double workflow/search triggered after selection in strategy matching (version 0.1.13)
Environment
@textcomplete/core version: 0.1.13
@textcomplete/textarea version: 0.1.13
- Basic setup without any additional configuration.
Minimal Repro Code
import { TextareaEditor } from '@textcomplete/textarea';
import { Textcomplete } from '@textcomplete/core';
const textarea = document.getElementById('editor');
const editor = new TextareaEditor(textarea);
const strategies = [{
id: 'strategyA',
match: /\\#$/,
context: (beforeCursor) => {
console.log('[Strategy A] workflow started with: ' + beforeCursor);
return true;
},
search: (term, callback) => {
console.log('[Strategy A] search:' + term);
callback([{ title: 'Local', text: 'L' }]);
},
template: (item) => `<div>${item.title} (${item.text})</div>`,
replace: () => '#L:'
}];
const textcomplete = new Textcomplete(editor, strategies);
Steps to Reproduce
- Type # into the textarea → dropdown appears.
- Observe logs:
[Strategy A] workflow started with: #
[Strategy A] search:undefined
- Select the suggestion → the textarea becomes #L:
- Observe logs again:
[Strategy A] workflow started with: #L:
[Strategy A] workflow started with: #L:
Expected Behavior
Only one search/workflow cycle should run after the suggestion selection.
Actual Behavior
Search/workflow is triggered twice — duplicate logs after replacement.
Sandbox
Problem Sample Sandbox link
Title
Double workflow/search triggered after selection in strategy matching (version 0.1.13)
Environment
@textcomplete/coreversion: 0.1.13@textcomplete/textareaversion: 0.1.13Minimal Repro Code
Steps to Reproduce
Expected Behavior
Only one search/workflow cycle should run after the suggestion selection.
Actual Behavior
Search/workflow is triggered twice — duplicate logs after replacement.
Sandbox
Problem Sample Sandbox link