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
Prev Previous commit
Next Next commit
Fix bad rebase and bad types
  • Loading branch information
sarayourfriend committed Aug 6, 2021
commit 630d060dce63af20b970c34bd889c11d62347a25
11 changes: 5 additions & 6 deletions packages/components/src/input-control/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
* External dependencies
*/
// eslint-disable-next-line no-restricted-imports
<<<<<<< HEAD
import type {
CSSProperties,
ReactNode,
ChangeEvent,
SyntheticEvent,
} from 'react';
=======
import type { CSSProperties, ReactNode, ChangeEvent } from 'react';
>>>>>>> 38b7df613c (Add back event to onChange)
import type { useDrag } from 'react-use-gesture';

/**
Expand Down Expand Up @@ -67,17 +63,20 @@ export interface InputBaseProps extends BaseProps, FlexProps {
}

export interface InputControlProps
extends Omit< InputBaseProps, 'children' >,
extends Omit< InputBaseProps, 'children' | 'isFocused' >,
/**
* The `prefix` prop in `PolymorphicComponentProps< InputFieldProps, 'input', false >` comes from the
* `HTMLInputAttributes` and clashes with the one from `InputBaseProps`. So we have to omit it from
* `PolymorphicComponentProps< InputFieldProps, 'input', false >` in order that `InputBaseProps[ 'prefix' ]`
* be the only prefix prop. Otherwise it tries to do a union of the two prefix properties and you end up
* with an unresolvable type.
*
* `isFocused` and `setIsFocused` are managed internally by the InputControl, but the rest of the props
* for InputField are passed through.
*/
Omit<
PolymorphicComponentProps< InputFieldProps, 'input', false >,
'stateReducer' | 'prefix'
'stateReducer' | 'prefix' | 'isFocused' | 'setIsFocused'
> {
__unstableStateReducer?: InputFieldProps[ 'stateReducer' ];
}
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/select-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function useUniqueId( idProp?: string ) {
return idProp || id;
}

export interface SelectControlProps extends Omit< InputBaseProps, 'children' > {
export interface SelectControlProps
extends Omit< InputBaseProps, 'children' | 'isFocused' > {
help?: string;
hideLabelFromVision?: boolean;
multiple?: boolean;
Expand Down