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.

TextInput's onLayout not called

See original GitHub issue

Not sure why the onLayout is not called in TextInput component but called in View component.

  <TextInput
              ref="textInput"
              onLayout={(e) => {
                console.log('--- this is not called?')
              }}
              style={{height: 44, color: 'black', borderColor: 'black', borderWidth: 1, paddingHorizontal: 10, marginHorizontal: 10}}
              placeholder='text here'
              text={'cool'}
              placeholderTextColor={'rgba(0,0,0,.4)'}
              underlineColorAndroid='rgba(0,0,0,0)'
            />

Sample project here

React Native version: 0.28.0 Target: iOS 9.3 Development OS: OS X

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
jjheskcommented, Nov 22, 2016

@facebook-github-bot open this is an outstanding bug and it is not fixed on version 0.38.0-rc1 I confirm

Read more comments on GitHub >

github_iconTop Results From Across the Web

TextInput onLayout not working · Issue #996 - GitHub
When I set onLayout event handler on a TextInput I get this error Warning: Unknown event handler property onLayout. It will be ignored....
Read more >
onLayout not being called - react native - Stack Overflow
In my case onLayout isn't called because items were rendered in FlatList so only several items were rendered on mount.
Read more >
[Solved]-onLayout not being called-React Native
Coding example for the question onLayout not being called-React Native.
Read more >
TextInput - React Native
A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, such as auto- ...
Read more >
Using onLayout | React Native By Example - Packt Subscription
To calculate a component's height, we can utilize its onLayout property to fire a ... The onLayout property is an event that is...
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