react native - Close keyboard when opening tab on a single click -
i want close keyboard when user clicks particular tab.
what's happening when keyboard open , user wants switch tab, must close/minimize keyboard first.
the prop on scrollview
keyboardshouldpersisttaps
want, scrollview
, not tabnavigator
component.
you can use function hide keyboard , call onclick
of tab.
this function should declare in same class in onclick
of tab exists.
@suppresswarnings("constantconditions") public void hidekeyboard(view view){ inputmethodmanager imm = (inputmethodmanager) getsystemservice(input_method_service); imm.hidesoftinputfromwindow(getcurrentfocus().getwindowtoken(),0); }
and onclick
, call using hidekeyboard();
.
hide keyboard whenever tab tapped. , should provide of code if seeking help.
Comments
Post a Comment