Skip to content

Focus on title when the new post loads#8826

Merged
hypest merged 3 commits intodevelopfrom
gb/focus_on_title_when_the_new_post_loads
Dec 20, 2018
Merged

Focus on title when the new post loads#8826
hypest merged 3 commits intodevelopfrom
gb/focus_on_title_when_the_new_post_loads

Conversation

@marecar3
Copy link
Copy Markdown
Contributor

Based on the issue .

On Gutenberg

  • New post -> title should be in focus and keyboard should be visible
  • Existing post -> nothing should be in focus and keyboard shouldn't be visible

Note: I have a problem to convert demonstration of this feature into .gif :(

- Set focus on title on the new post
@wpmobilebot
Copy link
Copy Markdown
Contributor

2 Warnings
⚠️ PR is missing at least one label.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

mIsNewPost = getArguments().getBoolean(ARG_IS_NEW_POST);
if (mIsNewPost) {
mTitle.requestFocus();
showImplicitKeyboard();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it required the call to showImplicitKeyboard?
I've commented it and didn't notice any difference testing on emulators.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing me out that. @daniloercoli, probably we can remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hey @daniloercoli , I checked on mobile device Nexus 5x, 8.1 Android and it can't work without showImplicitKeyboard

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

checked here as well on emulator and real device (Pixel 2) and confirmed the keyboard is not shown if that line is removed / commented out:

withoutshowkeyboard

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just to double check: tested the same on

  • Nexus 4 emulator with Android 5.1.1:
  • Nexus 5 emulator with Android 7.0

Observed the same behavior as above.

@mzorz mzorz added this to the 11.5 milestone Dec 19, 2018
Copy link
Copy Markdown
Contributor

@mzorz mzorz left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@hypest hypest merged commit 99e9ef1 into develop Dec 20, 2018
@hypest hypest deleted the gb/focus_on_title_when_the_new_post_loads branch December 20, 2018 08:58
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.

5 participants