Skip to content

Commit

Permalink
* [android] force hidden keyboard on input destroy (#61)
Browse files Browse the repository at this point in the history
* * [android] force hidden keyboard on input destroy

* * [android] hidden keyboard on input unfocused
  • Loading branch information
misakuo authored and sospartan committed Dec 13, 2016
1 parent a217d1b commit 43f5164
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,19 @@ protected WXEditText initComponentHostView(@NonNull Context context) {
return inputView;
}

@Override
protected void onHostViewInitialized(WXEditText host) {
super.onHostViewInitialized(host);
addFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(boolean hasFocus) {
if (!hasFocus) {
hideSoftKeyboard();
}
}
});
}

private void applyOnClickListener() {
addClickListener(new OnClickListener() {
@Override
Expand Down

0 comments on commit 43f5164

Please sign in to comment.