Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long InputLabel text overlaps FormControl when wrapped #18350

Closed
ErikParso opened this issue Nov 13, 2019 · 1 comment
Closed

Long InputLabel text overlaps FormControl when wrapped #18350

ErikParso opened this issue Nov 13, 2019 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@ErikParso
Copy link

ErikParso commented Nov 13, 2019

I have a Form control with Select component and InputLabel asisigned. When input label is too long, text is wrapped and overflows whole Select component like this:
image

Also when user sets value:
image

Is it possible to set autosize to Select component so label will fit in? Or set label to not wrap and text overflow to ellipsis ?

my component definition:

<FormControl className={styles['simple-select']}>
    <InputLabel id="label">{this.props.text}</InputLabel>
    <Select
        value={this.state.selectedItemsId}
        onChange={this.handleChange}
        labelId="label"
        renderValue={ ... }>

        {this.props.items.map(model => (
            <MenuItem
                key={model.id}
                value={model.id}>
                ...
            </MenuItem>
        ))}
    </Select>
</FormControl>

Label in Select component demo (https://codesandbox.io/s/material-demo-hcede) behaves same way (try to replace age with something longer).

@oliviertassinari oliviertassinari added the duplicate This issue or pull request already exists label Nov 13, 2019
@oliviertassinari
Copy link
Member

Duplicate of #12255

@oliviertassinari oliviertassinari marked this as a duplicate of #12255 Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants