fix(Input): floating label now floats when the input has a value
This commit is contained in:
parent
810e74e99f
commit
6c55b89ee2
@ -117,12 +117,8 @@ const Input = React.forwardRef(
|
||||
return (
|
||||
<InputWrapper className={className} width={width}>
|
||||
<InputInput
|
||||
onChange={() => {
|
||||
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}
|
||||
|
Loading…
Reference in New Issue
Block a user