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.

How to make ListItem textInput fill all available space?

See original GitHub issue

Hello! ListItem textInput maximum width is only half of item width:

<ListItem
    title='Address'
    textInput={true}
    textInputValue={this.state.address}
    textInputOnChangeText={address => this.setState({address})}
    hideChevron={true}
/>

photo5357560673846012065

How to make textInput width fill all available space like: photo5357560673846012063 and truncate text only when it begin overflowing left title? P.S.: Sorry for “adress” word) And for my English

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
xavier-villelegiercommented, Jan 2, 2018

Hey @evilandfox, you’re right, this is not well handled by the ListItem. Actually, the title has a flex: 1, so does the TextInput, so they are both taking half of the space. That shouldn’t be the case if there is a TextInput (The title shouldn’t have a flex: 1 in this case). 😕

I think you can use this dirty fix as a workaround for now:

<ListItem
  title='Address'
  textInput={true}
  textInputContainerStyle={{ flex: 3 }}
  hideChevron={true}
/>

This will give you this result: image

0reactions
ericmorgan1commented, Jun 20, 2018

@iRoachie Thanks! #1272

Read more comments on GitHub >

github_iconTop Results From Across the Web

Style input element to fill remaining width of its container
Here is a simple and clean solution without using JavaScript or table layout hacks. It is similar to this answer: Input text auto...
Read more >
fit-content - CSS: Cascading Style Sheets - MDN Web Docs
The fit-content behaves as fit-content(stretch). In practice this means that the box will use the available space, but never more than ...
Read more >
Filling space | React Material-UI Cookbook
Inside each of these Paper components, you have three Chip components, which are nested grid items. Here's what the code looks like: import...
Read more >
C38: Using CSS width, max-width and flexbox to fit labels ...
Define the width and max-width property for labels and inputs so they enlarge or shrink in the available space and respond to zoom...
Read more >
How to make a div fill a remaining horizontal space using ...
The width property is used to fill a div remaining horizontal space using CSS. By setting the width to 100% it takes 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