forwardRef used in defaultStyle to pass ref in MentionInput component#477
Open
gurpreet013 wants to merge 1 commit intosignavio:masterfrom
Open
forwardRef used in defaultStyle to pass ref in MentionInput component#477gurpreet013 wants to merge 1 commit intosignavio:masterfrom
gurpreet013 wants to merge 1 commit intosignavio:masterfrom
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/signavio/react-mentions/3o1fwEAEHh3f838yA6wyybinWV3X |
|
Any update on this PR ? |
Contributor
|
Thank you for the PR, @gurpreet013 The project has collected a few dust, but after a few changes in governance, I'm now reviewing/merging. |
Author
|
@atilafassina Any update on this? |
|
Hey 👋 I am +1 to look at this PR please. 🙏 Thank you :-) |
8265bf0 to
8dedc5d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #411
What did you change (functionally and technically)?
As MentionInput is wrapped by defaultStyle wrapper ref was not getting set. So In defaultStyle file under utils directory, i have used forwardRef to pass my ref to MentionInput component so that anyone can use MentionInput ref in their parent component.
Use Case
Recently i had a requirement in which after writing some query if there is only 1 suggestion and user enters space then that mention should get selected. To achieve this i checked there is no way to send custom key props in the react mention and i don't want to write
selectFocusedfunction code which covers all the use cases. So i want to use it through ref but due to the issue mentioned in #411. I was not able to do itChecklist (remove this list before you submit the PR)
Additional review hints (remove this list before you submit the PR)