Skip to content

onContentSizeChange support for growing multiline TextInput #6552

Closed
@brentvatne

Description

@brentvatne
Collaborator

Original discussion here: #1229 (comment)

Problem

the onChange event that we depend upon here only fires when a user enters text via a keyboard. This means that if there is more than one line of text loaded in (e.g. resuming a form), the height will be restricted to whatever the default is. Is there any way to trigger (or measure) the contentSize so that we can set an accurate initial height?

Potential solutions

Decision that needs to be made

  • Do we push forward with onContentSizeChange? (an aside, see our justification for naming).
  • If yes:
    • do we back out of providing layout information in the onChange event from TextInput and just provide it in onContentSizeChange?
    • who will implement this on iOS?

@nicklockwood @deanmcpherson @bestander

Activity

self-assigned this
on Mar 20, 2016
mangogogos

mangogogos commented on Jun 14, 2016

@mangogogos
Contributor

Any update on this? Most of the relevant issues have gone quiet

bestander

bestander commented on Jun 21, 2016

@bestander
Contributor

I posted internally to get some attention, sorry for the wait.
Meanwhile if this affects you and you want to raise visibility, create an entry in product pains

ghost added a commit that references this issue on Jul 7, 2016
holyxiaoxin

holyxiaoxin commented on Sep 8, 2016

@holyxiaoxin
Contributor

How is onContentSizeChange getting fired? I'm on Android and react-native v0.32.0, multiline is true. I only get onContentSizeChange fired for the first time, after that it doesn't fire even after i'm hitting the next line.

ghost
jayshah123

jayshah123 commented on Sep 23, 2016

@jayshah123
Contributor

Checking on v0.33 rn on android, multiline is true.
I only get onContentSizeChange fired for the first time, after that it doesn't fire even after i'm hitting the next line.

oargaruna

oargaruna commented on Sep 28, 2016

@oargaruna

Issue reported by @jayshah123 and @holyxiaoxin still persists on v0.34. For now I am using both onChange and onContentSizeChange. The former for Android and the latter for iOS.

snowjade

snowjade commented on Oct 8, 2016

@snowjade

Oh ,I get the same issue too as reported by @jayshah123 and @holyxiaoxin

25 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @brentvatne@jayshah123@ericvicenti@aleclarson@sibelius

      Issue actions

        onContentSizeChange support for growing multiline TextInput · Issue #6552 · facebook/react-native