Skip to content

Commit 78cc90c

Browse files
authored
fix(autocomplete): correct reposition when trigger changes (#99)
1 parent 102a78a commit 78cc90c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Textarea.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,8 @@ class ReactTextareaAutocomplete extends React.Component<
523523
if (
524524
movePopupAsYouType ||
525525
(top === null && left === null) ||
526-
// if we have single char - trigger it means we want to re-position the autocomplete
527-
lastToken.length === 1
526+
// if the trigger got changed, let's reposition the autocomplete
527+
this.state.currentTrigger !== currentTrigger
528528
) {
529529
const { top: newTop, left: newLeft } = getCaretCoordinates(
530530
textarea,

0 commit comments

Comments
 (0)