Skip to content
Closed
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 label type
  • Loading branch information
brookewp committed Jan 11, 2024
commit 0b2db3959d8b0beac740f10463398a6c9aa32786
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,5 @@ import type { LegacyCustomSelectProps } from './types';
import { useDeprecatedProps } from './use-deprecated-props';

export function LegacyAdapter( props: LegacyCustomSelectProps ) {
return (
<CustomSelect
{ ...useDeprecatedProps( props ) }
hideLabelFromVision={ props.hideLabelFromVision }
/>
);
return <CustomSelect { ...useDeprecatedProps( props ) } />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export type LegacyCustomSelectProps = {
/**
* Label for the control.
*/
label?: string;
label: string;
/**
* A function that receives the new value of the input.
*/
Expand Down
Copy link
Contributor Author

@brookewp brookewp Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to mark the props as to be deprecated, if we decide we want to go with this option

Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ export function useDeprecatedProps(
return {
...legacyProps,
children: transformOptionsToChildren( props ),
// temp ignore
//@ts-ignore
defaultValue: props?.value?.name ?? undefined,
label: props.label ?? '',
label: props.label,
hideLabelFromVision: props.hideLabelFromVision,
onChange: legacyChangeHandler,
size: adaptSizes( props ),
};
Expand Down