fix some auto complete issues
This commit is contained in:
@@ -96,10 +96,11 @@ export const TextInput = forwardRef(function TextInputImpl(
|
||||
newRt.detectFacetsWithoutResolution()
|
||||
setRichText(newRt)
|
||||
|
||||
const prefix = getMentionAt(
|
||||
newText,
|
||||
textInputSelection.current?.start || 0,
|
||||
)
|
||||
// NOTE: BinaryFiddler
|
||||
// onChangeText happens before onSelectionChange, cursorPos is out of bound if the user deletes characters,
|
||||
const cursorPos = textInputSelection.current?.start ?? 0
|
||||
const prefix = getMentionAt(newText, Math.min(cursorPos, newText.length))
|
||||
|
||||
if (prefix) {
|
||||
setAutocompletePrefix(prefix.value)
|
||||
} else if (autocompletePrefix) {
|
||||
|
||||
Reference in New Issue
Block a user