-
Notifications
You must be signed in to change notification settings - Fork 128
Fixes #4741 - Update color in text tool for localized sites #4749
Fixes #4741 - Update color in text tool for localized sites #4749
Conversation
@ianb Please review PR that fixes color selection inside Text tool for localized sites. Thanks |
Codecov Report
@@ Coverage Diff @@
## master #4749 +/- ##
=========================================
- Coverage 41.72% 41.7% -0.03%
=========================================
Files 43 43
Lines 1898 1899 +1
Branches 353 353
=========================================
Hits 792 792
- Misses 1106 1107 +1
Continue to review full report at Codecov.
|
Fixes #4741 |
@@ -108,9 +108,11 @@ exports.ColorPicker = class ColorPicker extends React.Component { | |||
|
|||
onClickSwatch(e) { | |||
const color = e.target.style.backgroundColor; | |||
const colorName = e.target.dataset.colorName.toLowerCase().replace(/\s/g, "-"); |
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.
There is no need to use regex here.
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.
A nit aboot using regex when a plain old string function would work. Otherwise WFM.
cdbbaf8
to
dff9cbb
Compare
@chenba Updated PR with the feedback. Thanks |
Hmm is there any reason that the data attributes aren't just the value we need? I don't see why they need to be user friendly strings. |
for now data values are used to point to correct css class and setting values to classnames can work. |
dff9cbb
to
553f81d
Compare
Updated to pick colorName directly from data values. |
No description provided.