-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[#155997991] reloading trigger matrix when text is pasted in to inputbar #17
Conversation
src/MentionsTextInput.js
Outdated
@@ -535,6 +535,17 @@ export default class MentionsTextInput extends Component { | |||
return; | |||
} | |||
|
|||
const isTextDifferenceGreaterThanOne = !this.state.text && text.length > 1 || this.state.text.length < text.length - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would probably do well in it's own function too, right? It doesn't seem to have much effect on the rest of this function, and just needs the text value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah theres already a getTextDifference function. the difference is that this one checks the difference before the the state is changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but inline means you can't write a test for it, which I think is worthwhile, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be worth putting this logic inside of its own function, too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I think the textDifferenceGreaterThanOne const should be its own function since it's doing computations that could potentially be useful later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.