question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Outlined input label not showing while using React Native LayoutAnimation in Android

See original GitHub issue

Environment

software version
ios or android android
react-native https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz
react-native-paper 4.7.2
node 15.4.0
npm or yarn yarn
expo sdk 40.0.0

Outlined input label not showing while using React Native LayoutAnimation in Android . Note: ios also works well.

Video: https://user-images.githubusercontent.com/32386753/110314781-5c89bb00-8019-11eb-9351-2b09a03d3a94.mp4

Code:

import {
// something...
  LayoutAnimation,
  UIManager,
  Platform
} from 'react-native';
    if (
         Platform.OS === 'android'
         && UIManager.setLayoutAnimationEnabledExperimental
       ) {
         UIManager.setLayoutAnimationEnabledExperimental(true);
       }
      
 // Somethingg....

      
     const _animationClick = () => {
       LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);  
       setIsRegister(!isRegister);
     };

 

// Somethingg…

         {isRegister && (

          <View style={Styles.input}>          
               
            <TextInput
              label={i18n.t('login.email')}
              value={email}
              mode="outlined"
              onChangeText={_onChangeEmail}
            />        

               
            <HelperText type="error" visible={errors.email}>
              Email address is invalid!
            </HelperText>
          
          </View>
        )}

Thank you for your help

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lukewalczakcommented, May 10, 2021

Looks like the issue is related to LayoutAnimation which is experimental on Android platform. I can suggest you to write your custom spring animation.

0reactions
aliburhankeskincommented, May 15, 2021

Thanks for your answer @lukewalczak. I will try your suggestion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Layout Animation does not work on Android even with ...
I've added the below code for the same. import { LayoutAnimation, NativeModules } from 'react-native'; // Animation setup for android const { ...
Read more >
ViewGroup - Android Developers
If you are implementing XML layout attributes as shown in the example, ... android:layoutAnimation, Defines the layout animation to use the first time...
Read more >
PDF React Native - Tutorialspoint
This tutorial is designed for JavaScript and React developers who aspire to learn mobile building skills. By following this course, you will expand...
Read more >
LayoutAnimation - React Native
Note that in order to get this to work on Android you need to set ... onAnimationDidEnd, function, No, Called when the animation...
Read more >
Drag and Drop Tags in React Native, Part 1 of 2: The Basics ...
If you're not familiar with create-react-native-app check out Building ... Next, let's start working on Tags component highlighted in the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found