diff --git a/src/checkbox/CheckboxGroup.tsx b/src/checkbox/CheckboxGroup.tsx index ab61ba0fc..ca929f2c3 100644 --- a/src/checkbox/CheckboxGroup.tsx +++ b/src/checkbox/CheckboxGroup.tsx @@ -133,7 +133,7 @@ export function CheckboxGroup(props: CheckboxGroupProps) { case 'string': { const vs = v as string; return ( - + {v} ); @@ -141,7 +141,7 @@ export function CheckboxGroup(props: CheckboxGroupProps) { case 'number': { const vs = v as number; return ( - + {v} ); @@ -152,7 +152,7 @@ export function CheckboxGroup(props: CheckboxGroupProps) { return vs.checkAll ? ( ) : ( - + ); } default: diff --git a/src/input/type.ts b/src/input/type.ts index 7dac1cb2f..e8ee71fec 100644 --- a/src/input/type.ts +++ b/src/input/type.ts @@ -141,7 +141,7 @@ export interface TdInputProps { /** * 回车键按下时触发 */ - onEnter?: (value: InputValue, context: { e: KeyboardEvent }) => void; + onEnter?: (value: InputValue, context: { e: KeyboardEvent }) => void; /** * 获得焦点时触发 */ @@ -149,15 +149,15 @@ export interface TdInputProps { /** * 键盘按下时触发 */ - onKeydown?: (value: InputValue, context: { e: KeyboardEvent }) => void; + onKeydown?: (value: InputValue, context: { e: KeyboardEvent }) => void; /** * 按下字符键时触发(keydown -> keypress -> keyup) */ - onKeypress?: (value: InputValue, context: { e: KeyboardEvent }) => void; + onKeypress?: (value: InputValue, context: { e: KeyboardEvent }) => void; /** * 释放键盘时触发 */ - onKeyup?: (value: InputValue, context: { e: KeyboardEvent }) => void; + onKeyup?: (value: InputValue, context: { e: KeyboardEvent }) => void; /** * 进入输入框时触发 */ diff --git a/src/select-input/useSingle.tsx b/src/select-input/useSingle.tsx index 21370640c..17c696d84 100644 --- a/src/select-input/useSingle.tsx +++ b/src/select-input/useSingle.tsx @@ -94,6 +94,9 @@ export default function useSingle(props: TdSelectInputProps) { props.onFocus?.(value, { ...context, inputValue: val }); !popupVisible && setInputValue(getInputValue(value, keys), { ...context, trigger: 'input' }); }} + onEnter={(val, context) => { + props.onEnter?.(value, { ...context, inputValue: val }); + }} {...props.inputProps} className={classNames(props.inputProps?.className, { [`${classPrefix}-input--focused`]: popupVisible, diff --git a/src/tag-input/useTagList.tsx b/src/tag-input/useTagList.tsx index 49a848ef2..d29f34bcc 100644 --- a/src/tag-input/useTagList.tsx +++ b/src/tag-input/useTagList.tsx @@ -73,7 +73,7 @@ export default function useTagList(props: TagInputProps) { const tagContent = isFunction(tag) ? tag({ value: item }) : tag; return ( onClose({ e: context.e, item, index })}