Skip to content

Commit

Permalink
fix(EditableInput): paste deletes # by default. (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 19, 2023
1 parent 1cece0f commit 6f62905
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/color-editable-input/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const EditableInput = React.forwardRef<HTMLInputElement, EditableInputProps>((pr
}, [props.value]);

function handleChange(evn: React.FocusEvent<HTMLInputElement>, valInit?: string) {
const value = valInit || evn.target.value;
const value = (valInit || evn.target.value).trim().replace(/^#/, '');
if (validHex(value)) {
onChange && onChange(evn, value);
}
Expand Down

0 comments on commit 6f62905

Please sign in to comment.