-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(text-field): autofocus floats label (material-components#875)
- Loading branch information
Matt Goo
committed
May 30, 2019
1 parent
d733c29
commit 9931969
Showing
7 changed files
with
141 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import TextField, {Input} from '../../../packages/text-field'; | ||
|
||
class OutlinedTextField extends React.Component<{}, {value: string}> { | ||
inputEl: Input<HTMLInputElement> | null = null; | ||
state = {value: ''}; | ||
|
||
onChange: (e: React.FormEvent) => void = (e) => | ||
this.setState({value: (e.target as HTMLInputElement).value}); | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<TextField label='Dog' outlined> | ||
<Input autoFocus value={this.state.value} onChange={this.onChange} /> | ||
</TextField> | ||
</div> | ||
); | ||
} | ||
} | ||
export default OutlinedTextField; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
export default ['standard', 'fullWidth', 'outlined', 'textArea', 'refTest']; | ||
export default [ | ||
'standard', | ||
'fullWidth', | ||
'outlined', | ||
'textArea', | ||
'refTest', | ||
'autoFocus', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters