-
Notifications
You must be signed in to change notification settings - Fork 50
[IMP] color-picker: remove additional # #6104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 17.0
Are you sure you want to change the base?
Conversation
237422d
to
7d360c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋
@@ -366,7 +366,7 @@ export class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEnv | |||
|
|||
setHexColor(ev: InputEvent) { | |||
// only support HEX code input | |||
const val = (ev.target as HTMLInputElement).value.slice(0, 7); | |||
const val = "#" + (ev.target as HTMLInputElement).value.replaceAll("#", "").slice(0, 6); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when pasting "fff#abc" (something that is clearly not valid), it becomes #fffabc
. Maybe we don't care. Or maybe you could just replace double #
. Your pick 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 If i copy #fff after #000, it would end up in #000fff, which is maybe a wrong behaviour ?
I'll change to replacing #* to #
How to reproduce Copy a color code (i.e. #E6F2F3) Create a custom table Edit its color using the color picker Double-click the current code and replace it by #E6F2F3 As the double-click doesn't grab the #, you get ##E6F2F Task: 4687930
7d360c6
to
28c90c5
Compare
How to reproduce
Copy a color code (i.e. #E6F2F3)
Create a custom table
Edit its color using the color picker
Double-click the current code and replace it by #E6F2F3
As the double-click doesn't grab the #, you get ##E6F2F
Task: 4687930
Description:
description of this task, what is implemented and why it is implemented that way.
Task: 4687930
review checklist