From 32d9728930f6a08e9f92146230b28d503f057f85 Mon Sep 17 00:00:00 2001 From: Hansu Kim <30749436+khsily@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:05:17 +0900 Subject: [PATCH] fix: suggestions not showing while composing (#683) * fix: suggestions not showing while composing * Add changeset --------- Co-authored-by: khsily --- .changeset/khaki-dryers-kneel.md | 5 +++++ src/MentionsInput.js | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/khaki-dryers-kneel.md diff --git a/.changeset/khaki-dryers-kneel.md b/.changeset/khaki-dryers-kneel.md new file mode 100644 index 00000000..a7a741c6 --- /dev/null +++ b/.changeset/khaki-dryers-kneel.md @@ -0,0 +1,5 @@ +--- +"react-mentions": patch +--- + +Fix suggestions not showing while composing diff --git a/src/MentionsInput.js b/src/MentionsInput.js index a69903ef..9efc60aa 100755 --- a/src/MentionsInput.js +++ b/src/MentionsInput.js @@ -564,6 +564,10 @@ class MentionsInput extends React.Component { let mentions = getMentions(newValue, config) + if (ev.nativeEvent.isComposing && selectionStart === selectionEnd) { + this.updateMentionsQueries(this.inputElement.value, selectionStart) + } + // Propagate change // let handleChange = this.getOnChange(this.props) || emptyFunction; let eventMock = { target: { value: newValue } }