Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

TextInput auto blur on first click (Android only) #1181

Open
devWaleed opened this issue May 19, 2021 · 29 comments
Open

TextInput auto blur on first click (Android only) #1181

devWaleed opened this issue May 19, 2021 · 29 comments

Comments

@devWaleed
Copy link

devWaleed commented May 19, 2021

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

software version
ios or android Android 10
react-native 0.63.4
react-native-tab-view 3.0.1
react-native-pager-view 5.1.9
node 14.13.1
npm or yarn yarn
@devWaleed devWaleed added the bug label May 19, 2021
@github-actions
Copy link

Couldn't find version numbers for the following packages in the issue:

  • expo

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:

  • react-native (found: 0.63.4, latest: 0.64.1)
  • react-native-pager-view (found: 5.1.3, latest: 5.1.9)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

@devWaleed
Copy link
Author

Not using Expo but react-native-cli and pager-view version is 5.1.9 updated but still issue.

@nathangabriel27
Copy link

Same problem here, I have 2 tabs when TextInput triggers onchange the keyboard automatically dismiss.

@nathangabriel27
Copy link

nathangabriel27 commented May 22, 2021

Code example:

import React, { useState } from 'react';

import { View, useWindowDimensions, TextInput } from 'react-native';
import { TabView, SceneMap } from 'react-native-tab-view';

export default function TabViewExample() {
  const layout = useWindowDimensions();
  
  const SecondRoute = () => (
  <View style={{ flex: 1, backgroundColor: '#ff4081' }} />
);
const [enterprise_types, setEnterprise_types] = useState('test')
const FirstRoute = () => (
   <View style={{ flex: 1, backgroundColor: '#673ab7' }} >
  <TextInput
           keyboardType="decimal-pad"
            returnKeyType={'search'}
            value={enterprise_types}
            onChangeText={(text) => setEnterprise_types(text)}
/>
  </View>
 );
const renderScene = SceneMap({
  first: FirstRoute,
  second: SecondRoute,
});

  const [index, setIndex] = React.useState(0);
  const [routes] = React.useState([
    { key: 'first', title: 'First' },
    { key: 'second', title: 'Second' },
  ]);

  return (
    <TabView
      navigationState={{ index, routes }}
      renderScene={renderScene}
      onIndexChange={setIndex}
      initialLayout={{ width: layout.width }}
    />
  );
}

@samakintunde
Copy link

Currently having this issue as well. The only way that I've been able to prevent the dismissal is to set keyboardDismissMode: 'none' on the TabView. I tried setting it to 'on-drag' but it still kept dismissing the keyboard once the tab view re-renders.

<TabView
    keyboardDismissMode="none" // set keyboardDismissMode to 'none'
    navigationState={{index, routes}}
    onIndexChange={setTabIndex}
    initialLayout={{width: layout.width}}
/>

@devWaleed
Copy link
Author

@samakintunde37 keyboardDismissMode="none" doesn't work for me. I am getting the same error.

@nicolak
Copy link

nicolak commented May 25, 2021

Same problem

@samakintunde
Copy link

@nathangabriel27 The issue with your component is the level you're declaring enterprise_types at.
If the state isn't being shared between both tabs, you should move the state into the FirstRoute component, where you need it and you should be good.

@samakintunde
Copy link

@devWaleed and @nicolak, check above. Same situation?

@nicolak
Copy link

nicolak commented May 25, 2021

const FirstRoute = () => {
        const [myValue, setMyValue] = useState('');
        return (
            <View style={{ flex: 1, backgroundColor: '#ff4081' }} >
                <C.TextoInput 
                    value={myValue}
                    onChangeText={(t)=>setMyValue(t)}
                />
            </View>
        ) };

That way, the keyboard does not close. However, when switching to another tab, the State myValue is reset to zero.

What to do?

@samakintunde
Copy link

samakintunde commented May 25, 2021

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}}
    />
  );
}

@nicolak
Copy link

nicolak commented May 25, 2021

Wow. It worked out. Thanks!

@samakintunde
Copy link

You're welcome!👍

@devWaleed
Copy link
Author

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.

// class Home extends React.Component

state = {
	currentTabIndex: 0,
};

tabRoutes = [
	{
		key: 'home',
		title: 'Home',
		icon: (color) => <Icon name="home" solid size={20} color={color} />,
	},
	{
		key: 'products',
		title: 'Products',
		icon: (color) => (
			<Icon name="shopping-bag" solid size={20} color={color} />
		),
	},
	{
		key: 'consultant',
		title: 'Consultant',
		icon: (color) => (
			<Icon name="user-clock" solid size={20} color={color} />
		),
	},
	{
		key: 'blogs',
		title: 'Blogs',
		icon: (color) => <Icon name="blogger-b" solid size={20} />,
	},
];

render() {
	return <View style={{ flex: 1 }}>
					{this.tabViews()}
				</View>
}

tabsSceneMap({ route }) {
	switch (route.key) {
		case 'home':
			return <HomeTab
				navigation={this.props.navigation}
				changeTabCallback={this.changeTabCallback}
			/>;
		case 'products':
			return <ProductsTab navigation={this.props.navigation} />;
		case 'consultant':
			return <Consultant />;
		case 'blogs':
			return <BlogsListing navigation={this.props.navigation} />;
	}
}

changeTabCallback = (tab) => {
	switch (tab) {
		case 'products':
			this.setState({
				currentTabIndex: 1,
			});
			this.props.setSearchBoolean(false);
			break;
		default:
			this.setState({
				currentTabIndex: 0,
			});
			break;
	}
};

tabViews() {
	return (
		<TabView
			lazy={true}
			swipeEnabled={false}
			renderTabBar={() => null}
			navigationState={{
				index: this.state.currentTabIndex,
				routes: this.tabRoutes,
			}}
			renderScene={this.tabsSceneMap}
			onIndexChange={(currentTabIndex) =>
				this.setState({ currentTabIndex })
			}
			initialLayout={{ width: windowWidth }}
		/>
	);
}

@moh3n9595
Copy link

Same issue

@MaxToyberman
Copy link

same for me

@dariomalfatti-centropaghe

solution of @samakintunde37 doesn't solve my issue, downgrade to 2.16.0 to temporary solve and wait a bug fix or a solution

@gamingumar
Copy link

gamingumar commented Jul 19, 2021

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.

@github-actions
Copy link

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.

@bayraak
Copy link

bayraak commented Aug 10, 2021

I have the same issue too

@babyrusa
Copy link

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.

@github-actions
Copy link

github-actions bot commented Oct 1, 2021

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.

@github-actions github-actions bot added the stale label Oct 1, 2021
@github-actions github-actions bot closed this as completed Oct 9, 2021
zdmc23 added a commit to DiscipleTools/disciple-tools-mobile-app that referenced this issue Apr 4, 2022
@EduFrazao
Copy link

EduFrazao commented Jul 4, 2022

The problem still persists. I also have to downgrade to version 2.16.0.
When a tab is selected with a focused textinput (via autoFocus or some listener that calls focus via some ref) the focus works, but in a second the keyboard is dismissed and focus is lost.
EDIT: Its hapenning in Android (8, 9, 10 and 11)

zdmc23 added a commit to DiscipleTools/disciple-tools-mobile-app that referenced this issue Jul 27, 2022
* 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 <191707+zdmc23@users.noreply.github.com>

* 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] <support@github.com>

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] <support@github.com>

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 <stevenshubham@Administrators-MacBook-Pro.local>

* 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 <stevenshubham@Administrators-MacBook-Pro.local>

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 <stevenshubham@Administrators-MacBook-Pro.local>

* 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 <43966676+mikeallbutt@users.noreply.github.com>
Co-authored-by: Mike Allbutt <yo@ur.id.au>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Steven Shubham <stevenshubham@Administrators-MacBook-Pro.local>
Co-authored-by: steven-shubham <104883753+steven-shubham@users.noreply.github.com>
Co-authored-by: Jackson Harry <jackson.isbd@gmail.com>
Co-authored-by: Maxwell <maxwellmdg@gmail.com>
@achalofficial
Copy link

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

@emilianraduu
Copy link

Happens to me as well

@okwasniewski
Copy link
Collaborator

Reopening this, since the issue still persists

@okwasniewski okwasniewski reopened this Oct 3, 2022
@github-actions github-actions bot removed the stale label Oct 4, 2022
@fmendoza
Copy link

fmendoza commented Oct 7, 2022

Yep, same issue here.

@lotusshinoaki
Copy link

lotusshinoaki commented Oct 28, 2022

My app also has the same issue.
I checked the call stack of TextInput.blur() and got the following stack trace.

01

This line in react-native-pager-view has keyboard close code that only works on Android (derivatively the TextInput loses focus).
https://github.com/callstack/react-native-pager-view/blob/0c65e4dbd296861855a3e3f5b0bb9942f2dc9248/src/PagerView.tsx#L71

After removing this Keyboard.dismiss() the TextInput no longer loses focus in my app.

Update
My workaround

  const [
    keyboardDismissMode,
    setKeyboardDismissMode,
  ] = React.useState<'none' | undefined>();
  const navigation = useNavigation();

  React.useEffect(() => {
    if (Platform.OS !== 'android') {
      return;
    }

    const unsubscribeOnFocus = navigation.addListener('focus', () => {
      setKeyboardDismissMode(undefined);
    });
    const unsubscribeOnBlur = navigation.addListener('blur', () => {
      setKeyboardDismissMode('none');
    });

    return () => {
      unsubscribeOnFocus();
      unsubscribeOnBlur();
    };
  }, [navigation]);

  return <TabView keyboardDismissMode={keyboardDismissMode} />;

@AwesomeDracula
Copy link

Adding animationEnabled={false} to solves the problem for me!
<TabView animationEnabled={false} navigationState={state} renderScene={_renderScene} renderTabBar={_renderTabBar} onIndexChange={_handleIndexChange} tabBarPosition="bottom" />

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

No branches or pull requests