From 259cd6f6e3a774da8dc05e814ca21891640580f8 Mon Sep 17 00:00:00 2001 From: Claire Hsu Date: Thu, 1 Aug 2019 12:03:16 -0700 Subject: [PATCH] fix(Input): Display floating input label if value is not undefined (#50) --- src/Form/Input.js | 2 +- src/Form/Label.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Form/Input.js b/src/Form/Input.js index de31d2e..f2956ca 100644 --- a/src/Form/Input.js +++ b/src/Form/Input.js @@ -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, diff --git a/src/Form/Label.js b/src/Form/Label.js index abf925c..f06541d 100644 --- a/src/Form/Label.js +++ b/src/Form/Label.js @@ -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 &&