-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add prop onInputTextChanged on GiftedChat API and help fix #286 #301
Conversation
@@ -82,7 +82,7 @@ export default class Message extends React.Component { | |||
<View> | |||
{this.renderDay()} | |||
<View style={[styles[this.props.position].container, { | |||
marginBottom: this.isSameUser(this.props.currentMessage, this.props.nextMessage) ? 2 : 10, | |||
marginBottom: this.isSameUser(this.props.currentMessage, this.props.nextMessage) ? this.props.marginSameUser : this.props.marginDifferentUser, |
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.
Hi @jayshah123
I think that this is not related to the original PR. In my opinion, is better to split this changes in two different PR.
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 sorry,
Actually in the PR I only want the first commit to go in (When I raised PR it had only the first commit) I have never sent a pull request before on a github.
How can I do that?
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.
@jayshah123 This is how github works, you stated that the master branch of your fork is the source of the PR so every change in it will be included, you could use a feature branch to achieve what you want
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.
Ok I think I will revert the second commit and that should remove it?
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.
Not sure :)
Give it a try
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.
Rewriting history is Ok? I will close PR, rewrite history and raise a fresh PR(with single commit).
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.
@jayshah123 Don't worry.
You only need to create a new branch in your fork, make the commit on it and create a new PR in the same way you created the previous one.
The Github documentation is better explained that my comment. Here you have some links. I hope it'll be useful for you.
https://guides.github.com/introduction/flow/
https://help.github.com/articles/creating-a-pull-request/
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.
Aha Got it thanks!
@@ -119,6 +119,8 @@ Message.defaultProps = { | |||
renderBubble: null, | |||
renderDay: null, | |||
position: 'left', | |||
marginSameUser: 6, |
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.
The original value was 2
. Just for curiosity, Why do you want to change it?
I'm a novice github user, |
This introduces a new prop : onInputTextChanged on GiftedChat API,
which is a callback function that will give whatever text is present currently in Composer back to user.
Composer has onChange prop but it is kind of consumed by onType function in GiftedChat.js.
This will also help fix #286, where you see GiftedChat.js personally uses onChange,
and the behaviour such as height calculation would have to be performed by library user (which right now happens in onType in GiftedChat.js)
This prop gives users a simpler interface to track change in input text, with all other features intact.
Kindly guide with suggestions/comments wherever feels necessary.
Thank you.