From 6c55b89ee2ef7d1d7a1f292f00525b4077b03e79 Mon Sep 17 00:00:00 2001 From: Jordan Knott Date: Thu, 16 Jul 2020 22:01:26 -0500 Subject: [PATCH] fix(Input): floating label now floats when the input has a value --- frontend/src/shared/components/Input/index.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/src/shared/components/Input/index.tsx b/frontend/src/shared/components/Input/index.tsx index 1857348..c640ef3 100644 --- a/frontend/src/shared/components/Input/index.tsx +++ b/frontend/src/shared/components/Input/index.tsx @@ -117,12 +117,8 @@ const Input = React.forwardRef( return ( { - console.log(`change ${$ref}!`); - if ($ref && $ref.current) { - console.log(`value : ${$ref.current.value}`); - setHasValue(($ref.current.value !== '' || floatingLabel) ?? false); - } + onChange={e => { + setHasValue((e.currentTarget.value !== '' || floatingLabel) ?? false); }} hasValue={hasValue} ref={$ref}