-
Notifications
You must be signed in to change notification settings - Fork 793
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
fix(comment): allow new lines in comments on Android #207
fix(comment): allow new lines in comments on Android #207
Conversation
Nice thank you! Will test this in a bit - will try and solve the issue happening on iOS myself as well 💃 |
@housseindjirdeh what's new? Did you manage to test? |
handleSubmit = (body: string): void => { | ||
this.props.onSubmitEditing(body); | ||
handleSubmitEditing = (body: string): void => { | ||
if (Platform.OS === 'android') { |
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.
@housseindjirdeh If there is this bug on iOS, can this condition be removed? It is necessary to check on iOS with these changes, and then you can remove this condition, and check without 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.
You can remove the condition, np with iOS
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.
Then new lines will be added to iOS, did you check?
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.
Yes I tested it without the condition, new lines are added but it still "a bug" when I post the comment (nothing is posted)
My apologies, my week has been swamped and I haven't had the chance to test it :( If not today then hopefully tomorrow and I'll let you know. The thing with iOS is that it's just the return key that's causing to post and I feel like there should be a prop or something similar to do newline instead. 🤔 |
@housseindjirdeh so by pressing the return key, a new line should be inserted? I thought the matter in the |
@@ -301,7 +301,7 @@ class Issue extends Component { | |||
} | |||
issueLocked={issue.locked} | |||
language={language} | |||
onSubmitEditing={this.postComment} |
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.
Now you can only set the onSubmit
handler. The onSubmitEditing
handler as I understand it is necessary to do some actions before sending.
@@ -113,12 +120,12 @@ export class CommentInput extends Component { | |||
: translate('issue.main.commentInput', language) | |||
} | |||
multiline | |||
blurOnSubmit | |||
blurOnSubmit={false} | |||
onChangeText={text => this.setState({ text })} | |||
onContentSizeChange={event => | |||
this.setState({ height: event.nativeEvent.contentSize.height })} | |||
onSubmitEditing={event => |
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.
According to the doc the onSubmitEditing
is useless
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.
Yes, but even if it is removed (or false
), the problem remains. As I wrote, this is due to non-standard keyboards (on Android at least). Therefore, need to add an new line. I do not know how things are on iOS? Maybe there is enough to remove blurOnSubmit
.
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.
Rather, it's because of my other changes, I changed the handlers (onSubmit
, onSubmitEditing
)? It would be cool to solve this on iOS, because everything is good on Android.
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, so let me try to fix this one for iOS :)
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.
What kind of handler is needed to send?
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.
Idk, can you post a comment from Android (with these changes)?
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.
Yes, it's sent ... and wait .. After all, we have a comment sent only by the "Post" button, just there is a send handler.
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's sufficient :)
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 do not understand why on iOS does not work? Do I need to remove the condition?
This is a test sent from iOS With new lines. UPD: @lex111 no problem with iOS dude ❤️ ❤️ |
@Antoine38660 It is perfectly! It turns out we can merge? |
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.
Of course yes :D
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.
Thanks a million @lex111, and thanks for testing this beauty @Antoine38660 🎉
* docs(README.md): add translation instruction (gitpoint#255) * chore(commit): Make the repo Commitizen-friendly (gitpoint#240) * chore(commit): Make the repo Commitizen-friendly * docs(contributors): change my profile url * docs(CONTRIBUTING.md): add information about Commitizen * docs(CONTRIBUTING.md): move translations snippet * docs(CONTRIBUTING.md): update commitzen snipper grammar * fix(comment-input): add new lines when writing issue comments on Android (gitpoint#207) * feat(repo): add label to show watch status (gitpoint#227) * Added react-native-cli to avoid onboarding issues in the future * Pull down to refresh implemented in profile page * Pull down to refresh implemented in Repository page. Closes gitpoint#103. * Fixed some merge issues * Fixing some more merging issues * Forgot to add myself as a contributor. * Fetching user data and fetching repository data have been moved into their own functions. * Fixed some merge issues. * Renamed the function that fetches the information to be a bit more descriptive * Again, fixing my own merge issues. Doing it here with code highlight and VSCode yelling at me is easier than on the Github editor. * Fixed some merge issues, _again_ * Added pull to refresh to the non auth profile screen. Other minor improv. * Fixing indentation inside of `<ScrollView />` * Removing extra newline * Adding a newline between our components and vendor components. * Added myself as a contributor. Code and Bug Reports * Valid NPM versions need to include three parts (x.y.z) * Removed the double ScrollView. Parallax can now take in refreshControl. Profile Screen, Repo, and Auth User screen have pull to refresh. * Pull down to refresh now in Issue/PR page (comment list) * Fixed some merging issues and yarn lockfile * Organizations are now refreshable * Better behavior on the AuthUser pull to refresh * Even better experience when refreshing AuthProfile. Now we have a flag when we _have_ a profile * Refreshing on Issues (specifically) works again * Used '!!' instead of '|| false' as per suggestion Temporal fix, I still want to figure out why isPendingComments and isPendingIssue are undefined. * Add a (watching) label that shows when a user is watching a repo already. * Fixed to look like gitpoint/master * feat(repository): fixed location of Watchers label * Minor code change to keep consistent with the style of the rest of the repo * docs: improve word choice (gitpoint#244) * Improved CONTRIBUTING.md * Improved contributing.md * docs(README.md): add contributor * fix(repo): Show repo prefix for search repo result (gitpoint#254) * fix(repo): hide issues section in forked repo (gitpoint#257)
Fixes #206.
Need to check on iOS. There I understand, there was no such problem?