Skip to content

Commit

Permalink
feat: list offset (#2228)
Browse files Browse the repository at this point in the history
Co-authored-by: chen_gh <[email protected]>
  • Loading branch information
gh2049 and chen_gh authored Mar 25, 2024
1 parent 0f82746 commit 121f7ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/list/inner/CascaderItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const CascaderItem: React.ForwardRefRenderFunction<
HTMLLIElement,
CascaderItemProps & Omit<DOMAttributes<HTMLLIElement>, 'onClick'>
> & { isItem?: boolean } = (
{ label, value, children, childrens = [], disabled, onClick: propsOnClick, strategy = 'fixed', ...rest },
{ label, value, children, childrens = [], disabled, onClick: propsOnClick, strategy = 'fixed', offset = [0, 12], ...rest },
ref?
) => {
const prefixCls = usePrefixCls('cascader');
Expand Down Expand Up @@ -106,7 +106,7 @@ const CascaderItem: React.ForwardRefRenderFunction<
strategy={strategy}
distoryOnHide
delay={200}
offset={[0, 12]}
offset={offset}
>
{element}
</Popover>
Expand Down
2 changes: 2 additions & 0 deletions src/list/interfance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export interface CascaderItemProps extends BaseItemProps {
label: string;
value: string | number;
strategy?: 'fixed' | 'absolute';
offset?: number[];
childrens?: CascaderItemProps[];
}
export interface ItemProps
Expand All @@ -138,6 +139,7 @@ export interface ItemProps
> {
selectValue?: string | string[];
strategy?: 'fixed' | 'absolute';
offset?: number[]
}

export interface BaseItemProps extends Pick<OptionProps, 'value' | 'disabled' | 'prefix' | 'suffix' | 'wrapper'> {
Expand Down

0 comments on commit 121f7ba

Please sign in to comment.