Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Improve Focus/Blur handling and show the keyboard accordingly#75

Merged
mzorz merged 4 commits intomasterfrom
add/focus-commands-show-keyboard
Nov 22, 2018
Merged

Improve Focus/Blur handling and show the keyboard accordingly#75
mzorz merged 4 commits intomasterfrom
add/focus-commands-show-keyboard

Conversation

@daniloercoli
Copy link
Copy Markdown
Contributor

@daniloercoli daniloercoli commented Nov 22, 2018

This PR does fix the issue where the keyboard is not shown on the screen when you tap on a AztecWrapper field in RN applications.
It also add 2 other new features (one of those were already present but never exposed to JS) for focus/blur handling in JS.

Details:

  • Adds the ability to listen on blur and focus events from the JS side. We can now use onBlur, and onFocus and attach a JS function to it.

  • Does fix an issue where the keyboard is not shown on the screen when the edit field get the focus.

  • Adds the ability to set focus or unset it via JS. There are 2 new commands (focusTextInput and blurTextInput ) that can be invoked JS side to trigger the native side to get or lost the focus.

Test 1

  • Start the demo app
  • Check that onBlur and onFocus log lines are present in the log when you jump between fields

Test 2 (External test with a RN app)

  • Use gb-mobile master and point react-native-aztec to this hash 357a9a4
  • Then start the demo gb-mobile app, and tap/jump between AztecWrapper powered blocks
  • The keyboard should be visible on the screen
  • Dismiss the keyboard
  • Tap on a AztecWrapper powered block. The keyboard should be visible now.

I will provide a GB-mobile side PR once this is merged in master

@daniloercoli daniloercoli requested a review from mzorz November 22, 2018 16:53
@daniloercoli daniloercoli changed the title [WIP] Improve Focus/Blur handling and show the keyboard accordingly Improve Focus/Blur handling and show the keyboard accordingly Nov 22, 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, does everything as advertised.
Note for future reference, the mentioned "fix" lies in the overriden @Override public boolean requestFocus method where a call to showSoftKeyboard is made.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants