Skip to content

[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

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

fdamhaut
Copy link
Contributor

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

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

@robodoo
Copy link
Collaborator

robodoo commented Apr 14, 2025

Pull request status dashboard

@fdamhaut fdamhaut force-pushed the 17.0-color-picker-paste-hex-flda branch from 237422d to 7d360c6 Compare April 15, 2025 08:22
Copy link
Contributor

@hokolomopo hokolomopo left a 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);
Copy link
Contributor

@hokolomopo hokolomopo Apr 15, 2025

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 🤷

Copy link
Contributor Author

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
@fdamhaut fdamhaut force-pushed the 17.0-color-picker-paste-hex-flda branch from 7d360c6 to 28c90c5 Compare April 17, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants