onTextLayOut is not getting triggered
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 127k
- Forks
- 25.3k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 4
Description
Description
For a text component , if we specify onTextLayout and write log statement, its not getting triggered.
i wanted to use the onTextLayout to get the no of lines being rendered for a given text width. The no of lines might change based on the width prop in style.
Therefor, i would like to get the no of lines to do some operation on text when it exceeds max lines limit.
React Native Version
0.70.2
Output of npx react-native info
N/A
Steps to reproduce
Write a text component and define "onTextLayout" prop to send in the handler.
The handler doesn't get triggered even during the first layout render.
Snack, code example, screenshot, or link to a repository
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Snack reproduction and the Text component's onTextLayout behavior; verify whether the handler fires on the reported React Native 0.70.2 setup. Done means the handler fires during layout and exposes the rendered line count, including when the text width changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100