-
Notifications
You must be signed in to change notification settings - Fork 1.1k
TextInput auto blur on first click (Android only) #1181
Comments
Couldn't find version numbers for the following packages in the issue:
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3. The versions mentioned in the issue for the following packages differ from the latest versions on npm:
Can you verify that the issue still exists after upgrading to the latest versions of these packages? |
Not using Expo but react-native-cli and pager-view version is 5.1.9 updated but still issue. |
Same problem here, I have 2 tabs when TextInput triggers onchange the keyboard automatically dismiss. |
Code example:
|
Currently having this issue as well. The only way that I've been able to prevent the dismissal is to set <TabView
keyboardDismissMode="none" // set keyboardDismissMode to 'none'
navigationState={{index, routes}}
onIndexChange={setTabIndex}
initialLayout={{width: layout.width}}
/> |
@samakintunde37 keyboardDismissMode="none" doesn't work for me. I am getting the same error. |
Same problem |
@nathangabriel27 The issue with your component is the level you're declaring |
@devWaleed and @nicolak, check above. Same situation? |
That way, the keyboard does not close. However, when switching to another tab, the State What to do? |
export default function TabViewExample() {
// Keep state outside the components so it persists across tabs
const [myValue, setMyValue] = useState('');
const layout = useWindowDimensions();
const [index, setIndex] = React.useState(0);
const [routes] = React.useState([
{key: 'first', title: 'First'},
{key: 'second', title: 'Second'},
]);
// Use a custom renderScene function instead
const renderScene = ({route}) => {
switch (route.key) {
case 'first':
return (
<View style={{flex: 1, backgroundColor: '#ff4081', padding: 48}}>
<TextInput
style={{backgroundColor: '#fff'}}
value={myValue}
onChangeText={setMyValue}
/>
</View>
);
case 'second':
return <View style={{flex: 1, backgroundColor: '#ff4081'}} />;
default:
return <View />;
}
};
return (
<TabView
navigationState={{index, routes}}
renderScene={renderScene}
onIndexChange={setIndex}
initialLayout={{width: layout.width}}
/>
);
} |
Wow. It worked out. Thanks! |
You're welcome!👍 |
Here is my code. I am using class based components. On my Home component/screen I am returning few views and TabView is one of them. I have used tabsSceneMap as a custom sceneMap function already. All my tab tab screens are React.PureComponent. Still the issue persist for me.
|
Same issue |
same for me |
solution of @samakintunde37 doesn't solve my issue, downgrade to 2.16.0 to temporary solve and wait a bug fix or a solution |
I am having this issue in iOS. Any text input in a tabview hides the keyboard and it doesn't open again. Downgraded to 2.16.0 for the fix. |
Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup. The easiest way to provide a repro is on snack.expo.dev. If it's not possible to repro it on snack.expo.dev, then please provide the repro in a GitHub repository. |
I have the same issue too |
I'm having the same issue on IOS (it works fine on Android) for version 3.1.1. Downgraded to 2.16.0 and it worked. |
Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it. |
The problem still persists. I also have to downgrade to version 2.16.0. |
* reference app name as a constant * chevron icon w/ RTL support * enable swipe, wrap-around swipe, and lift-up state to prevent re-render of index * adjust badge offset for Android * update "Name" icon to be more general and represent various post types (per MexSurfer) * improve navigation and fix navigation bugs * Icons and prettier (#620) * Only Prettier * Prettier * Icon for coaches field * add padding to offline bar * Setup offlineBar * New icon for name field * Revert "New icon for name field" This reverts commit 40a7db7. * Corrected icon for training * Icons: training & parent & name * meeting time logo in training post type * I18n.t setup for languages (#621) * Only Prettier * Prettier * Icon for coaches field * add padding to offline bar * Setup offlineBar * New icon for name field * Revert "New icon for name field" This reverts commit 40a7db7. * Corrected icon for training * Icons: training & parent & name * meeting time logo in training post type * translate Components with i18n * translate Comments and Activity Component with i18n * Prettier & translate hooks with i18n * Fix after bad push Co-authored-by: Zac Mac <[email protected]> * 5 icons for the Four Fields tab in a group * addNewContact icon * support API updates or Notifications * better scrolling for Android, remove Sheet Header in scroll view * offline filter support * add default options for Kebab * translation updatess * named Android detection * style updates and add gutters where appropriate * ensure Home tab button click re-renders Home (rather than prev screen in Home Stack) * reintroduce Comments and Activity support * enable contentContainerStyle for Tiles * update deprecated property * resolve Comments bug with missing ID value * controls styling and display * ConnectionField bugfixes * reintroduce TDM design for GroupView support * FieldTypes.LOCATION: map-marker (#623) * Add UserIcon to be used on the login screen * fix GroupView scroll bug * reimplement church health viz (view only) * (temporarily?) reuse multi-select component to edit church health * remember user filter selections (across every post type) * consistently refer to name-conflict local fns with underscore * move notifications back to tab bar * fix "forgot password" link bug; new Button and Link components * change AccountIcon to UserIcon in Login screen * support add new for all post types * do not display chip when no user is assigned * Colors for status fields in lists (#624) * New colors for status dots in list view * Dynamic colors for status's in lists * support determining whether is device or simulator * indicator highlight for bottom tabs * revert back to previous tab component for more features * Bump plist from 3.0.4 to 3.0.5 (#625) Bumps [plist](https://github.com/TooTallNate/node-plist) from 3.0.4 to 3.0.5. - [Release notes](https://github.com/TooTallNate/node-plist/releases) - [Changelog](https://github.com/TooTallNate/plist.js/blob/master/History.md) - [Commits](https://github.com/TooTallNate/node-plist/commits) --- updated-dependencies: - dependency-name: plist dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix list display bug for users and locations fields * preliminary support for any custom post type * center etcetera indicator * fix bug caused by circular dependencies in use-type and use-custom-post-types * remove RefreshControl on Home to make less jittery * remove lazy render option on tab scroll bc it makes text fields unusable on Android * resolve keyboard auto dismiss issue - see: satya164/react-native-tab-view#1181 * Theme and style changes (#626) * better handle custom post types per: DiscipleTools/disciple-tools-theme#1617 * external link icon for kebabs * reintroduce support for import contacts from phone * update required banner * enable favorite toggle from details screen * fix sort * theme the alert icon * New icons * New icons & adjusted cancel, close * done, cancel, close (accept, decline) * Use CommentActivityIcon (from CommentEditIcon) * debug comments losing status on expand * fix persistent filter bug with comments<->contacts * fix bug with toggling theme * Corrected links to help documents + formatted icons file (#628) * Group icons - black and white (from DT dark blue) parent, peer, child, type & types * Reverted cancel icon to be a X The icon named cancel is not common so it is best to use the X to indicate cancel. * removed extra ; from color code in 2 places * update language files * update translation terms, align LockIcon, and remove print stmts * no need to force locale in this component * remove registration of push notifications from App to navigation/AppNavigator where we have access to "navigation" object to navigate app to applicable post record * improved i18n * Create people-groups.svg * Create baptise.svg * reintroduce push notification support * i18n for date strings, add FAB to comments/activities screen * auto-size bottom sheets * introduce haptic feedback for certain buttons (eg, favorites), meatball w/ sheet for post items * bugfixes * Bump async from 2.6.3 to 2.6.4 (#629) Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4. - [Release notes](https://github.com/caolan/async/releases) - [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md) - [Commits](caolan/async@v2.6.3...v2.6.4) --- updated-dependencies: - dependency-name: async dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * upgrade to Expo v44 * comply with RN render errors * more responsive notification updates, remove save toast for more native feel * performance improvements (memoization, pure components, etc...) * setup icons for user tab + fab * svg icons for groups * bugfixes and style changes * introduce UserScreen (app settings/prefs, personal notes, more D.T settings to come * performance improvements * reintroduce more responsive PendingContactCard * include icons for fixed filters (Notifications, Comments/Activities) and bottom sheets (Item meatball) * reintroduce cancel button on bottom sheets * ref: 6276c6d * support for locally packaged svg icons * peer, child icons svg * update child.svg * Update of people-groups.svg simple re-export to remove width and heights (like the other svgs have) * Better icon for the trees icon * new svg (people groups, group type) * Different members icon * updated communication icons (address, other and else) * removed unneeded iconStyle = { transform: [{ scaleX: -1 }] } * Removal of unused png files * removal of references to unused png icons * fix bug with onDone() in sheet footer * renamed icon to baptismsIcon * fix typo * added svg TypeIcon for certain fields * list performance improvements * memoizing on fields was preventing MoreScreen from rendering custom post type buttons immediately * fix broken filter switch, improve filter default selection, styles, check string representation in useEffect dep array * Title for `My User` screen * Read and Unread icons for Notifications * Rename baptism icons, reorder of list to match field order in app * Typo: baptizeIcon (not baptiseIcon) * memoize by value so as to not recv an error about stringifying "cyclic structures" * Added ActivityIcon * Icons: baptism_date, archive * only display update req alert on status tabview * vibrate only on save button press (\rather than state updates in some cases) * rename PostLink to PostChip * safety check for defaultIndex * fix bug for missing contact record options in details sheets * fix border edges on KeySelect field * add vibration feedback on Chip remove * remove redundant view (pressable inherits view) * fix custom post type bug * added More screen kebab menu * View on web home screen URL mod. This will still take the user to the dashboard (if that plugin is installed) which is like the app home screen, or to whatever DT uses as the root. * Kebab on create/new record screen * add Contact type icons * Standardised the kebab menu It was the only screen using a different way of appearing which caused it to be in a slightly different position. Now it is the same as all others. * Kebab for import contact screen * include created and modified dates on list items, i18n number formatting, improved date handling, and styles * leave post header visible when opening bottom sheets (for record context) * truncate title * improve ux when loading bottom sheet with "Done" option * bugfix per AssignedTo field * bugfix for removing AssignedTo chip, and cleanup * documentation links in kebab to Create, Details, List screens * bugfix to handle multi-select field values onDone * get screen width dynamically * see: 017d76c * bugfix for undefined status and introduce info icons in list items * bugfix for user select chip links * reorg info icons as subtitle in lists * bugfix for PostChip links, simplyify ConnectionField, enable Custom Post Type Connections * cleanup per: 76ffd12 * fix location field to enable add new (currently unable to support remove bc mobile app plugin endpoint does not return "grid_meta_id" req for deletion * fix for "isRequired" translation * show quick action FAB for contacts only * enable navigation to comments/activity screen from custom post types * persist filters by ID * Icon refinements and additions * reenable route-based filters * fix duplicate issue with Locations * enable custom icon for Alert banner * use "UpdateRequiredIcon" for consistency * group connection fields without existing values should behave like typical dropdown sheet * support newer and older version of available post types in settings * fix comment bug * adjust: AddNewIcon + LogsIcon * svg baptize icons for fields * SubscriptionsIcon + TrainingsIcon (school) * Icons for fields about baptism * support dynamic custom quick action buttons * auto-open sort sheet to 66% to better ensure all options are displayed * kebab: My user icons + comment activity * upgrades: SWR 1.3 for better optimisticUI interface, Expo v45, TypeScript deps * filter out duplicate requests from offline queue * see: 782ab87 * Icon changes to work with updated font library * recommit icon changes after revert, and remove redundant lines * introduce Slider component for Arrow implementation * O365 Login and 2FA * Fix: font icon was renamed in recent update This fixes the missing icon for the first item in the records FAB * general refactoring * update deps * reintroduce offline support (has known issues!) * Slider and few bugs resolved. * prettier definition and husky pre-commit config * update husky and jest * prettier test * re-init husky * clean up * run prettier on all source files * Update store docs * Update README.md * Changed protocol to https. * HTML markup for Comments/Activities * Removed console logs, implemented separate loading spinners for login, showed baptized details in church health. * Removed extra space at end of the link * use placeholder on More screen * treat More as its own type (to distinguish settings) * extended language support * style LogsIcon as placeholder * options to prevent Image flicker per facebook/react-native#981 ; temporarily remove unused icons * decode HTML entities in Comments/Activities * fix spacing issue between comment link and comment text * bugfix * swap out deprecated properties * some addl performance improvements * fix locations select bug on create new * fix bottom margin block issue on filterlist * export asset as PNG (it was actually a JPG renamed as PNG) to pass Play Store build review * initial version of eas config file * Dynamic icons for Church Health and Bottom Sheet for icon hint. (#633) * Dynamic icons for Church Health. * Removed console logs. * Updated package-lock.json Co-authored-by: Steven Shubham <[email protected]> * update expo-notifications package * support redux migrations for versions that break on persistent state mismatch * manually update shell-quote package (per dependabot) * manually update hermes-engine package (per dependabot) * Sort icons new and improved sort icons appear in the sort bottom sheet * Accordion component for activity log (#693) * Dynamic icons for Church Health. * Removed console logs. * Updated package-lock.json * Accordion component for activity log * Additional Checks while showing the activity log. Co-authored-by: Steven Shubham <[email protected]> Resolves #651 * bump version * Resolves #686 - timestamp to date according to latest PR (#697) * Fixed Slider issue on Android and minor improvements. (#698) * Fixes #691 - auto-migrate persisted state when newer version requires it * general refactor and performance improvements (more memoization) * update dependency packages per Expo warning * Fixes #692 (offline cache) and fixes push notification issue * revert in-app MFA flow in anticipation of switching to web-based login * Fixes #638 * Resolved O365 redirection issue and broken filters. (#703) * Dynamic icons for Church Health. * Removed console logs. * Updated package-lock.json * Accordion component for activity log * Additional Checks while showing the activity log. * Resolved dark theme issue in AllActivityLogsScreen * Fixed Slider issue on Android and minor improvements. * Resolved O365 redirection issue and broken filters. * Mark all notifications as read. * Removed LoginScreen, use-auth and package-lock files. * Resolved Conflicts * Resolved use-notifications conflict Resolves #646 and Fixes #532 Co-authored-by: Steven Shubham <[email protected]> * Resolves #632, clean up rehydration * Activity,Comment and search screen small bug fixes (#701) * Resolves #686 - timestamp to date according to latest PR * Resolve - #699 Resolve - #666 Resolve - #635 Resolve - #566 Resolve - #674 Resolve - #669 activitylog mention date, comment activity mentions and date format, search screen * resolve conflict * search bar useeffect typo mistake * default to expanded accordions * fix toggle favorites on lists, general refactor and perf improvements * more reactive response to mark all notifications * improved language switching * improved offline experience * Dev/704 (#707) * LabeledTextInput refactor * LoginScreen refactor * Changing instance of LabeledTextInput on Otp screen * Refactor Login Screen and LabeledTextInput Resolves #704 * Html entities decode text in NotificationsScreen (#706) * update CI/CD (#708) Co-authored-by: MexSurfer <[email protected]> Co-authored-by: Mike Allbutt <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Steven Shubham <[email protected]> Co-authored-by: steven-shubham <[email protected]> Co-authored-by: Jackson Harry <[email protected]> Co-authored-by: Maxwell <[email protected]>
Same issue Still Persists... I changed the function calling from (e) => function_name(e) to function_name but.... As soon as i enter the value it triggers the onChangeText () and hence leads to hiding keyboard... Kindly resolve the error |
Happens to me as well |
Reopening this, since the issue still persists |
Yep, same issue here. |
My app also has the same issue. This line in react-native-pager-view has keyboard close code that only works on Android (derivatively the TextInput loses focus). After removing this Update
|
Adding animationEnabled={false} to solves the problem for me! |
Current behaviour
I have 2 tabs. First tab is active by default (i.e initial tab). Second tab has a TextInput. When I start app, click on second tab header it shows me second tab contents i.e the TextInput. When I click on the text field for typing it opens keyboard than auto closes for first time only. I am getting blur event on TextInput field. If I click again everything works fine.
Expected behaviour
On click on TextInput should open keyboard like normal.
Code sample
Simple Two tabs code with first as default open and second as inactive but having TextInput.
What have you tried
I have verified by putting blur event handler on TextInput. I am getting this event on Android only.
Your Environment
The text was updated successfully, but these errors were encountered: