Timeline for Hide keyboard in react-native
Current License: CC BY-SA 4.0
38 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 6, 2021 at 17:42 | comment | added | Somnath Kadam | not working, if user move from previous screen which open keypad for text input, with react-navigation v6 | |
| Nov 28, 2021 at 2:27 | comment | added | glushkina1 | Hey everyone, could anyone help me? <TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}> breaks my input in the web version, I can't write inside the input anything. Are any ideads to fix it? | |
| Nov 26, 2021 at 3:12 | review | Suggested edits | |||
| Nov 26, 2021 at 8:26 | |||||
| Mar 31, 2021 at 23:09 | comment | added | Julian | This is stellar - for web react I've done this and was going to try this approach stackoverflow.com/questions/56804790/… . with a little fiddling for RN porting i feel like it might work for proof of concept, but until then this HOC worked great! thanks | |
| Jan 21, 2021 at 11:47 | comment | added | Jarrett GXZ |
Ok my mistake was because i called Keyboard.dimiss instead of Keyboard.dismiss()
|
|
| Dec 16, 2020 at 21:37 | comment | added | hakki |
keyboardShouldPersistTaps='handled' is the magic.
|
|
| Apr 26, 2020 at 15:52 | comment | added | Dimitri Kopriwa | Why create an HoC and just add this in the root of your app tree / | |
| Jul 28, 2019 at 18:28 | comment | added | King Friday | I won't downvote this but please remove it or change it as its incorrect and misleading. See 'onStartShouldSetResponder on a parent View' answers as the correct behavior with less effort. | |
| May 27, 2019 at 14:12 | comment | added | Johncy |
Keyboard can not dismiss after use Alert ! TextInput has bluronSubmit={false}. Make the field focused and show some alert. After press ok on Alert, when i try to dismiss the keyboard tapping outside the TextInput is not working!
|
|
| Feb 10, 2019 at 20:46 | comment | added | Anthony De Smet | If you really just wanted a View and none of the ScrollView behaviour, it helps to add bounces={false} as a property to the ScrollView. Otherwise you get the elastic overscroll on iOS. | |
| Aug 27, 2018 at 0:19 | history | edited | Eric Kim | CC BY-SA 4.0 |
add code snippet to allow people to use ScrollView instead
|
| S Aug 20, 2018 at 5:46 | history | edited | Eric Kim | CC BY-SA 4.0 |
Added a way to correctly dismiss keyboard while using ScrollView
|
| S Aug 20, 2018 at 5:46 | history | suggested | Community Bot | CC BY-SA 4.0 |
Added a way to correctly dismiss keyboard while using ScrollView
|
| Aug 20, 2018 at 5:38 | review | Suggested edits | |||
| S Aug 20, 2018 at 5:46 | |||||
| Jul 13, 2018 at 0:45 | review | Suggested edits | |||
| Jul 13, 2018 at 5:51 | |||||
| S Apr 15, 2018 at 15:08 | history | edited | SherylHohman | CC BY-SA 3.0 |
typos, code formatting
|
| S Apr 15, 2018 at 15:08 | history | suggested | David Schumann | CC BY-SA 3.0 |
added syntax highlighting
|
| Apr 15, 2018 at 14:34 | comment | added | Hobbyist | This solution works, but please keep in mind that you can not use swipe gestures in children of a Touchable component. | |
| Apr 15, 2018 at 12:44 | review | Suggested edits | |||
| S Apr 15, 2018 at 15:08 | |||||
| Feb 28, 2018 at 8:44 | comment | added | Harikrishnan |
This solution will also work for text input inside List.
|
|
| Feb 21, 2018 at 1:58 | comment | added | James Trickey | This is the solution i used and I thought it had worked. One of my views contains a ListView though and unfortunately it seems that swipes dont make it through the TouchableWithoutFeedback element. Has anyone else encountered this? Thanks | |
| Jan 21, 2018 at 3:16 | comment | added | Jun | My mistake. The onPress event was captured by other buttons in the parent container. But, it does work if there is no other component within the parent component to capture the touch event. | |
| Jan 21, 2018 at 2:42 | comment | added | Jun | <TouchableWithoutFeedback onPress={this.press}> <View > <Text style={{fontSize: 20}}>test</Text> </View> </TouchableWithoutFeedback> It seems to work with Text but when I have a TextInput, the tap is not caught by the TouchableWithoutFeedback's onPress. Any idea how to make it work? | |
| S Dec 3, 2017 at 17:12 | history | suggested | marco.marinangeli | CC BY-SA 3.0 |
Added a property that is necessary not to ruin the accessibility system that react-native has for blind people
|
| Dec 2, 2017 at 11:27 | review | Suggested edits | |||
| S Dec 3, 2017 at 17:12 | |||||
| Dec 2, 2017 at 11:18 | comment | added | marco.marinangeli | I used this solution, but then i discovered Accessibility problems. Voice will not work inside the TouchableWithoutFeedback element. Anyone with the same problem found a solution? EDIT: the solution was to simply set "accessible={false}" on the element! | |
| Nov 1, 2017 at 21:31 | comment | added | Bradley |
Turns out my TouchableWithoutFeedback component was just wrapping my input, and therefore wasn't triggering because I couldn't actually click on it (Clicking on TextInput overrides TouchableWithoutFeedback's `onPress' - makes sense). Had to zoom out and wrap the parent component.
|
|
| Nov 1, 2017 at 20:30 | comment | added | Bradley |
I can't get onPress for TouchableWithoutFeedback to fire no matter what I try
|
|
| Oct 15, 2017 at 23:41 | review | Suggested edits | |||
| Oct 16, 2017 at 7:12 | |||||
| Oct 6, 2017 at 6:17 | review | Suggested edits | |||
| Oct 7, 2017 at 7:29 | |||||
| Sep 26, 2017 at 20:47 | comment | added | jwinn |
This works great. I had to change the syntax a little for the definition of the arrow function, to remove an unexpected token error in RN: const DismissKeyboardHOC = (Comp) => {
|
|
| Mar 23, 2017 at 0:37 | comment | added | Eric Kim | @PavleLekic Sorry for the delay, I updated the answer along with the HOC method | |
| Mar 23, 2017 at 0:31 | history | edited | Eric Kim | CC BY-SA 3.0 |
Removed flowtype
|
| Mar 23, 2017 at 0:11 | history | edited | Eric Kim | CC BY-SA 3.0 |
Now using Keyboard exposed by react-native
|
| Dec 9, 2016 at 9:04 | comment | added | Pavle Lekic | This is great, the only comment I have is that you could have used the official Keyboard api in RN, and called Keyboard.dismiss() instead of calling some RN internal utility dismissKeyboard(). But both work fine currently. | |
| Aug 19, 2016 at 13:53 | vote | accept | TurboFish | ||
| Jan 14, 2016 at 23:17 | history | edited | Eric Kim | CC BY-SA 3.0 |
Updated solution to a better one
|
| Jan 14, 2016 at 0:09 | history | answered | Eric Kim | CC BY-SA 3.0 |