From 6f629057ba0f580634f0cdafbb397fd32905c13d Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Thu, 19 Oct 2023 19:25:41 +0800 Subject: [PATCH] fix(EditableInput): paste deletes `#` by default. (#130) --- packages/color-editable-input/src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/color-editable-input/src/index.tsx b/packages/color-editable-input/src/index.tsx index 06ec0a77a..469e46cf7 100644 --- a/packages/color-editable-input/src/index.tsx +++ b/packages/color-editable-input/src/index.tsx @@ -40,7 +40,7 @@ const EditableInput = React.forwardRef((pr }, [props.value]); function handleChange(evn: React.FocusEvent, valInit?: string) { - const value = valInit || evn.target.value; + const value = (valInit || evn.target.value).trim().replace(/^#/, ''); if (validHex(value)) { onChange && onChange(evn, value); }