Skip to content
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

Merged
merged 1 commit into from
Aug 16, 2017

Conversation

lex111
Copy link
Member

@lex111 lex111 commented Aug 6, 2017

Fixes #206.

Need to check on iOS. There I understand, there was no such problem?

@housseindjirdeh
Copy link
Member

Nice thank you! Will test this in a bit - will try and solve the issue happening on iOS myself as well 💃

@lex111
Copy link
Member Author

lex111 commented Aug 9, 2017

@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') {
Copy link
Member Author

@lex111 lex111 Aug 9, 2017

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.

Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member

@Antoine38660 Antoine38660 Aug 13, 2017

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)

@housseindjirdeh
Copy link
Member

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. 🤔

@lex111
Copy link
Member Author

lex111 commented Aug 10, 2017

@housseindjirdeh so by pressing the return key, a new line should be inserted? I thought the matter in the onSubmitEditing handler, because it was sending a message, and now it happens in the onSubmit handler. Perhaps this will help for iOS?

@@ -301,7 +301,7 @@ class Issue extends Component {
}
issueLocked={issue.locked}
language={language}
onSubmitEditing={this.postComment}
Copy link
Member Author

@lex111 lex111 Aug 10, 2017

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.

@andrewda andrewda changed the title Fix adding of new lines when writing issue comments on Android fix(comment): allow new lines in comments on Android Aug 11, 2017
@@ -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 =>
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

@Antoine38660 Antoine38660 Aug 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried to post a comment with new line from the iOS simulator and nothing was posted...
simulator screen shot 12 aout 2017 a 21 28 22

Copy link
Member Author

@lex111 lex111 Aug 12, 2017

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.

Copy link
Member

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 :)

Copy link
Member Author

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?

Copy link
Member

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)?

Copy link
Member Author

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.

Copy link
Member

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 :)

Copy link
Member Author

@lex111 lex111 Aug 14, 2017

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?

@Antoine38660
Copy link
Member

Antoine38660 commented Aug 14, 2017

This is a test sent from iOS

With new lines.

UPD: @lex111 no problem with iOS dude ❤️ ❤️
simulator screen shot 14 aout 2017 a 20 26 06

@lex111
Copy link
Member Author

lex111 commented Aug 15, 2017

@Antoine38660 It is perfectly! It turns out we can merge?

Copy link
Member

@Antoine38660 Antoine38660 left a 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

Copy link
Member

@housseindjirdeh housseindjirdeh left a 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 🎉

@housseindjirdeh housseindjirdeh merged commit a961bbe into gitpoint:master Aug 16, 2017
reyhansofian added a commit to reyhansofian/git-point that referenced this pull request Aug 16, 2017
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants