From 121f7ba41cd3ba3ff9967735ce1bcfd788bc1667 Mon Sep 17 00:00:00 2001 From: G_H Date: Mon, 25 Mar 2024 20:07:31 +0800 Subject: [PATCH] feat: list offset (#2228) Co-authored-by: chen_gh --- src/list/inner/CascaderItem.tsx | 4 ++-- src/list/interfance.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/list/inner/CascaderItem.tsx b/src/list/inner/CascaderItem.tsx index b2df640b54..d793c65a1b 100644 --- a/src/list/inner/CascaderItem.tsx +++ b/src/list/inner/CascaderItem.tsx @@ -17,7 +17,7 @@ const CascaderItem: React.ForwardRefRenderFunction< HTMLLIElement, CascaderItemProps & Omit, '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'); @@ -106,7 +106,7 @@ const CascaderItem: React.ForwardRefRenderFunction< strategy={strategy} distoryOnHide delay={200} - offset={[0, 12]} + offset={offset} > {element} diff --git a/src/list/interfance.ts b/src/list/interfance.ts index 6326f47654..9143c5ed19 100644 --- a/src/list/interfance.ts +++ b/src/list/interfance.ts @@ -115,6 +115,7 @@ export interface CascaderItemProps extends BaseItemProps { label: string; value: string | number; strategy?: 'fixed' | 'absolute'; + offset?: number[]; childrens?: CascaderItemProps[]; } export interface ItemProps @@ -138,6 +139,7 @@ export interface ItemProps > { selectValue?: string | string[]; strategy?: 'fixed' | 'absolute'; + offset?: number[] } export interface BaseItemProps extends Pick {