Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
components: InputControl to TypeScript
  • Loading branch information
sarayourfriend committed Aug 6, 2021
commit ef5731dacaf38c2ae97cd66259ff01de25ef63a4
6 changes: 3 additions & 3 deletions packages/components/src/input-control/input-field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function InputField(

const handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {
onBlur( event );
setIsFocused( false );
setIsFocused?.( false );

/**
* If isPressEnterToChange is set, this commits the value to
Expand All @@ -123,7 +123,7 @@ function InputField(

const handleOnFocus = ( event: FocusEvent< HTMLInputElement > ) => {
onFocus( event );
setIsFocused( true );
setIsFocused?.( true );
};

const handleOnChange = ( event: ChangeEvent< HTMLInputElement > ) => {
Expand All @@ -135,7 +135,7 @@ function InputField(
const nextValue = event.currentTarget.value;

try {
onValidate( nextValue, event );
onValidate( nextValue );
commit( nextValue, event );
} catch ( err ) {
invalidate( err, event );
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/input-control/reducer/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function mergeInitialState(
...initialInputControlState,
...initialState,
initialValue: value,
};
} as InputState;
}

/**
Expand Down