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

WIP: messages: Do not close keyboard when tapping messages #2157

Closed

Conversation

borisyankov
Copy link
Contributor

This should work but doesn't. Relevant:
facebook/react-native#16826

@gnprice
Copy link
Member

gnprice commented Apr 4, 2018

I don't totally follow -- do you mean the existing code should work, but doesn't because of that RN bug?

Why a ScrollView? I'd worry a bit about nesting a ScrollView with the scrolling in the MessageListContainer. Does this code definitely prevent the ScrollView from doing any scrolling? If so, could we move this workaround into our KeyboardAvoider? If it'd be a problem there, why is it harmless here? (These aren't rhetorical questions; there may be perfectly good answers to them, I'd just like to know the answers and see them written down.)

Another thing I notice as I look at the existing code around this: our KeyboardAvoider is actually just a nop View on Android, while it's a real KeyboardAvoidingView on iOS. Why is that? Is the issue this PR is fixing also iOS-specific?

@borisyankov
Copy link
Contributor Author

Yeah, the code is correct, but doesn't work with WebView because of RN.
ScrollView has the keyboardShouldPersistTaps property but not View.
In fact, we would prefer not to add a ScrollView if possible.

@borisyankov
Copy link
Contributor Author

The KeyboardAvoider is trying to abstract away the difference in the behavior between the two platforms. After we added it, few bug fixes were done in RN related to the KeyboardAvoidingView.
It is possible at this moment we may no longer need it, or that we still do (but requires investigation)

@gnprice
Copy link
Member

gnprice commented Apr 12, 2018

Thanks, that's helpful. I'd still like to know in particular, though: does this code definitely prevent the ScrollView from doing any scrolling? That's the possibility that would make me concerned about us merging a workaround like this.

Also: why don't we want to close the keyboard when tapping messages?

@borisyankov
Copy link
Contributor Author

Yes, the ScrollView definitely does not break anything, but also does not work, so no point in merging.
This behavior is more consistent with other chat apps.

@borisyankov borisyankov changed the title messages: Do not close keyboard when tapping messages WIP: messages: Do not close keyboard when tapping messages Apr 12, 2018
@gnprice
Copy link
Member

gnprice commented Apr 13, 2018

Yes, the ScrollView definitely does not break anything, but also does not work, so no point in merging.

I see. OK, that is what I tried to clarify above -- when you say "This should work" and "the code is correct, but doesn't work", I do not know if you mean

  • the existing code that is currently in master; or
  • the code in the PR.

That's why I asked my first question above; and I really thought your answer was confirming that you believe the current code in master is "correct, but doesn't work". Now I think you were referring to the code in the PR.

So let's try to be super explicit about this; it's not fun to talk past each other.

This behavior is more consistent with other chat apps.

I think here you mean the behavior that this PR was intended to get, where tapping on messages doesn't close the keyboard. Can you confirm whether that's what you mean?

@gnprice
Copy link
Member

gnprice commented Apr 13, 2018

Doing a super quick survey of some other chat apps, on Android:

  • Facebook Messenger does the thing I think I expect: if the keyboard is open and you tap on a message, the keyboard closes so you can comfortably read more messages.
  • Google Hangouts and WhatsApp do nothing when you tap on a message. You can close the keyboard by hitting the system back button.
  • Slack takes you to a screen just for the message when you tap on a message, and the keyboard naturally disappears too.

So that's 2/4 where the keyboard goes away, and 1/3 out of those that don't navigate to another screen. That seems like enough diversity that just consistency isn't a strong reason to prefer something.

@borisyankov
Copy link
Contributor Author

I tested all you listed, plus Slack and Discord which also did not hide the keyboard.
The behavior was strongly in favor of keeping it (2:1) and also there were user reports that this was not behaving as they expected.

@gnprice
Copy link
Member

gnprice commented Apr 13, 2018

I listed Slack:

Slack takes you to a screen just for the message when you tap on a message, and the keyboard naturally disappears too.

What did you observe specifically -- was it different from that?

Count me as a user report that keeping the keyboard in view would be not behaving as I expect. :-)

@borisyankov
Copy link
Contributor Author

borisyankov commented Apr 13, 2018

I meant 'Skype'.
It is misbehaving anyways. We can revisit at a later point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants