mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-01 21:27:15 +00:00
Fixed Bug: Alpha slider doesn’t move, only the color slider is movable in tag color picker (#4359)
This commit is contained in:
parent
49fda0fbf4
commit
cf7cefe203
@ -78,6 +78,7 @@
|
||||
"react-syntax-highlighter": "^15.4.4",
|
||||
"react-timezone-select": "^1.1.15",
|
||||
"react-visibility-sensor": "^5.1.1",
|
||||
"rgb-hex": "^4.0.0",
|
||||
"sinon": "^11.1.1",
|
||||
"start-server-and-test": "1.12.2",
|
||||
"styled-components": "^5.2.1",
|
||||
|
||||
@ -6,6 +6,8 @@ import { ApolloError } from '@apollo/client';
|
||||
import styled from 'styled-components';
|
||||
import { ChromePicker } from 'react-color';
|
||||
import ColorHash from 'color-hash';
|
||||
import rgbHex from 'rgb-hex';
|
||||
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { useGetTagQuery } from '../../graphql/tag.generated';
|
||||
import { EntityType, FacetMetadata, Maybe, Scalars } from '../../types.generated';
|
||||
@ -256,10 +258,6 @@ export default function TagStyleEntity({ urn, useGetSearchResults = useWrappedSe
|
||||
saveColor();
|
||||
};
|
||||
|
||||
const handleColorChange = (color: any) => {
|
||||
setColorValue(color?.hex);
|
||||
};
|
||||
|
||||
// Update Description
|
||||
const updateDescriptionValue = (desc: string) => {
|
||||
setUpdatedDescription(desc);
|
||||
@ -314,7 +312,10 @@ export default function TagStyleEntity({ urn, useGetSearchResults = useWrappedSe
|
||||
</TagName>
|
||||
{displayColorPicker && (
|
||||
<ColorPickerPopOver ref={colorPickerRef}>
|
||||
<ChromePicker color={colorValue} onChange={handleColorChange} />
|
||||
<ChromePicker
|
||||
color={colorValue}
|
||||
onChange={(c) => setColorValue(`#${rgbHex(c.rgb.r, c.rgb.g, c.rgb.b, c.rgb.a)}`)}
|
||||
/>
|
||||
</ColorPickerPopOver>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@ -14722,6 +14722,11 @@ rework@1.0.1:
|
||||
convert-source-map "^0.3.3"
|
||||
css "^2.0.0"
|
||||
|
||||
rgb-hex@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/rgb-hex/-/rgb-hex-4.0.0.tgz#02fb1e215e3fe5d070501579a3d2e4fa3c0acec8"
|
||||
integrity sha512-Eg2ev5CiMBnQ9Gpflmqbwbso0CCdISqtVIow7OpYSLN1ULUv2jTB9YieS1DSSn/17AD7KkPWDPzSFzI4GSuu/Q==
|
||||
|
||||
rgb-regex@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user