Skip to content

Commit

Permalink
Fix placement of FlexProps type
Browse files Browse the repository at this point in the history
`InputControl` itself does not accept `Flex` props. Only `InputBase` does.
  • Loading branch information
mirka committed Apr 6, 2022
1 parent 42ddd30 commit a682653
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/components/src/input-control/input-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
LabelWrapper,
} from './styles/input-control-styles';
import type { InputBaseProps, LabelPosition } from './types';
import type { FlexProps } from '../flex/types';

function useUniqueId( idProp?: string ) {
const instanceId = useInstanceId( InputBase );
Expand Down Expand Up @@ -65,7 +66,7 @@ export function InputBase(
size = 'default',
suffix,
...props
}: InputBaseProps,
}: InputBaseProps & FlexProps,
ref: ForwardedRef< HTMLDivElement >
) {
const id = useUniqueId( idProp );
Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/input-control/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type { useDrag } from '@use-gesture/react';
* Internal dependencies
*/
import type { StateReducer } from './reducer/state';
import type { FlexProps } from '../flex/types';
import type { WordPressComponentProps } from '../ui/context';

export type LabelPosition = 'top' | 'bottom' | 'side' | 'edge';
Expand Down Expand Up @@ -56,7 +55,7 @@ export interface InputFieldProps extends BaseProps {
onDrag?: ( dragProps: DragProps ) => void;
}

export interface InputBaseProps extends BaseProps, FlexProps {
export interface InputBaseProps extends BaseProps {
children: ReactNode;
prefix?: ReactNode;
suffix?: ReactNode;
Expand Down

0 comments on commit a682653

Please sign in to comment.