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

[TextField] Fix width issue #6096

Merged
merged 1 commit into from
Feb 9, 2017
Merged

[TextField] Fix width issue #6096

merged 1 commit into from
Feb 9, 2017

Conversation

oliviertassinari
Copy link
Member

  • PR has tests / docs demo, and is linted.
  • Commit and PR titles begin with [ComponentName], and are in imperative form: "[Component] Fix leaky abstraction".
  • Description explains the issue / use-case resolved, and auto-closes the related issue(s) (http://tr.im/vFqem).

Closes #5834.

@oliviertassinari oliviertassinari added component: text field This is the name of the generic UI component, not the React module! next labels Feb 9, 2017
@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Feb 9, 2017
},
input: {
margin: 10,
},
largeInput: {
margin: 10,
width: 300,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would omit largeInput here and use the same input class. Add it to the outer: { width: 300 } to the outermost <div/>, it would better prove that the width fills the given space.

ref={(c) => { this.focusInput = c; }}
className={classes.input}
value="Large input"
className={classNames(classes.input, classes.large)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

className={classes.input}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That won't work, the <Input /> do not grow by default. Here is the output with what you are suggesting:
capture d ecran 2017-02-09 a 21 12 27

Here is the same output by using <input /> intead of <Input />.

capture d ecran 2017-02-09 a 21 14 02

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I must have something different in my app, you are right with your original code.

value="Error"
className={classes.input}
/>
<div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

className={classes.large}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might rename large to outerContainer

@oliviertassinari oliviertassinari merged commit 183310a into next Feb 9, 2017
@oliviertassinari oliviertassinari deleted the text-field-width branch February 9, 2017 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TextField/Input] focus/error underline are not bounded by the input element
3 participants