Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
fix(Input): Display floating input label if value is not undefined (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Claire Hsu authored Aug 1, 2019
1 parent a55b4a9 commit 259cd6f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/Form/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class Input extends Component {
...rest
} = this.props;

const isFloating = (floating && value && value.length > 0) || (floating && this.state.value);
const isFloating = floating && value != undefined && `${value}`.trim();

const inputProps = {
...rest,
Expand Down
1 change: 0 additions & 1 deletion src/Form/Label.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const Label = createComponent({
transition: 250ms;
font-weight: 500;
margin: 0 0 4px 4px;
z-index: 10;
font-size: ${p => p.theme.fontSizes[p.size]}px;
${isFloatable &&
Expand Down

0 comments on commit 259cd6f

Please sign in to comment.