fix: preserve preceding space when inserting tag/file from typeahead (Vibe Kanban) (#1495)
* All type checks pass. The fix is complete.
**Summary:** Fixed the issue in `frontend/src/components/ui/wysiwyg/plugins/file-tag-typeahead-plugin.tsx:117-122`. When selecting a tag or file from the typeahead menu, the code now checks if the replaced text started with whitespace and preserves it by prepending a space to the inserted content.
* Done. The more elegant fix is now in place - a single line change in the `triggerFn`:
```typescript
replaceableString: match[0].slice(match[0].indexOf('@')),
```
This excludes the preceding space from `replaceableString` at the source, so the `onSelectOption` handler remains simple with no conditional logic.
This commit is contained in:
committed by
GitHub
parent
b8abd9a05e
commit
b818f32b1e
@@ -100,7 +100,7 @@ export function FileTagTypeaheadPlugin({ projectId }: { projectId?: string }) {
|
|||||||
return {
|
return {
|
||||||
leadOffset: offset,
|
leadOffset: offset,
|
||||||
matchingString: match[1],
|
matchingString: match[1],
|
||||||
replaceableString: match[0],
|
replaceableString: match[0].slice(match[0].indexOf('@')),
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
options={options}
|
options={options}
|
||||||
|
|||||||
Reference in New Issue
Block a user