Skip to content

Commit

Permalink
fix(select): clear missing (#1825)
Browse files Browse the repository at this point in the history
Co-authored-by: maxin <maxin@growingio.com>
  • Loading branch information
nnmax and maxin authored Jan 25, 2022
1 parent 422687e commit a353ac6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/input/InputButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const InputButton = React.forwardRef<HTMLInputElement, InputButtonProps>((props,
className={classNames(inputCls, wrapperCls)}
type="button"
// when set Input type=button, the placeholder is invalid
value={value || placeholder}
value={value ?? placeholder}
title={value as string}
onChange={onChange}
prefix={customizePrefix}
Expand Down
1 change: 1 addition & 0 deletions src/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const Select: React.FC<SelectProps> & { isSelect?: boolean } = (props) => {
const handleOnClear = (e: React.MouseEvent<Element, MouseEvent>) => {
onClear?.();
onChange?.();
setValue('');
handVisibleChange(false);
e.stopPropagation();
};
Expand Down

1 comment on commit a353ac6

@vercel
Copy link

@vercel vercel bot commented on a353ac6 Jan 25, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.