Skip to content

Commit

Permalink
fix(inputs): remove from state, detect by value prop
Browse files Browse the repository at this point in the history
  • Loading branch information
reme3d2y committed Mar 4, 2020
1 parent e0abeba commit 208c07e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/base-input/src/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export const BaseInput = React.forwardRef<HTMLInputElement, BaseInputProps>(({
dataTestId
}, ref) => {
const [focused, setFocused] = useState(false);
const [filled, setFilled] = useState(!!value);

const filled = !!value;
const hasLabel = !!label;

function handleInputFocus(e: React.FocusEvent<HTMLInputElement>) {
Expand All @@ -99,8 +99,6 @@ export const BaseInput = React.forwardRef<HTMLInputElement, BaseInputProps>(({
}

function handleInputChange(e: React.ChangeEvent<HTMLInputElement>) {
setFilled(!!e.target.value);

if (onChange) {
onChange(e);
}
Expand Down

0 comments on commit 208c07e

Please sign in to comment.