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

Tapping on a Page Break block does make the block-holder selected but keep the keyboard up, and the caret to the Para block #308

Closed
daniloercoli opened this issue Nov 30, 2018 · 6 comments
Milestone

Comments

@daniloercoli
Copy link
Contributor

This is related to #306 - This time the selection of Page Break block happens by the "user" with the cursor/tapping, instead of programatically like in #306, but the end result is the same.

Steps to repro:

  • Tap on a para block
  • Tap on the page break block
  • The block holder is selected, but the soft keyboard is still up, and the caret blinking in the previous para block
  • If you tap on the keyboard characters are inserted in the para block
@koke koke mentioned this issue Nov 30, 2018
12 tasks
@hypest hypest added this to the Alpha milestone Dec 3, 2018
@hypest
Copy link
Contributor

hypest commented Dec 3, 2018

Added this to the Alpha milestone but it's not a blocker for the Alpha.

@koke
Copy link
Member

koke commented Dec 4, 2018

I think this is a duplicate of #197?

When a non textual block (e.g. image, more) is selected, hide the keyboard.

I think we want this for the alpha, focus should follow the selected block, it's really confusing when it doesn't

@daniloercoli
Copy link
Contributor Author

Re-opened this since the fix introduced a problem with the keyboard. (#383)

@daniloercoli
Copy link
Contributor Author

The tentative fix for this issue is available here: WordPress/gutenberg#12765
but then reverted since introduced a problem with the Keyboard dismissed when tapping Enter. Details: #381 (comment)

@daniloercoli
Copy link
Contributor Author

As per chat convo, this here https://github.com/facebook/react-native/blob/1151c096dab17e5d9a6ac05b61aacecd4305f3db/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java#L46 should be the right direct to go (removes the nasty side effect that EditTexts have, which is that focus is always maintained on one of the EditTexts).

@koke
Copy link
Member

koke commented Dec 19, 2018

removes the nasty side effect that EditTexts have, which is that focus is always maintained on one of the EditTexts

For reference, I think I managed to work around that by adding this in the app:
https://gist.github.com/koke/b572a7c4e203bf92c50d7c57b614e82c

However that didn't solve the keyboard being dismissed. I think the logic was right to dismiss the keyboard from RichText on split, but then the new block wasn't regaining focus. My hypothesis is that we handle the focus on componentDidUpdate, which won't get called since it's a newly created component, not an update to an existing one. We might have to replicate some of it on componentDidMount, but I haven't tested any of that.

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

No branches or pull requests

3 participants