|
1 | | -import React, {forwardRef, useEffect, useRef, useState} from 'react'; |
| 1 | +import React, {forwardRef, useEffect, useRef} from 'react'; |
2 | 2 | import {Col, InputGroup, Row} from "react-bootstrap"; |
3 | 3 | import {useColorEditContext} from "../../hooks/context/colorEditContextHook.jsx"; |
4 | 4 | import {useTranslation} from "react-i18next"; |
5 | 5 | import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; |
6 | | -import {getContrastColor} from "../../util/colors.js"; |
7 | 6 | import {faCheck, faExclamationTriangle, faPalette, faPlus, faTrash} from "@fortawesome/free-solid-svg-icons"; |
8 | 7 | import ActionButton from "../input/ActionButton.jsx"; |
9 | 8 | import DangerButton from "../input/button/DangerButton.jsx"; |
10 | 9 | import SecondaryActionButton from "../input/button/SecondaryActionButton.jsx"; |
11 | 10 | import Chrome from "@uiw/react-color-chrome"; |
12 | 11 | import {GithubPlacement} from '@uiw/react-color-github'; |
13 | 12 | import Wheel from "@uiw/react-color-wheel"; |
14 | | -import {getColorArrayConverter, getColorConverter} from "../../util/Color.js"; |
| 13 | +import {getColorArrayConverter, getColorConverter, getContrastColor} from "../../util/Color.js"; |
15 | 14 |
|
16 | 15 |
|
17 | 16 | const ColorInput = forwardRef(({color, contrastColor, invalid, onChange}, ref) => { |
18 | | - const [focused, setFocused] = useState(true); |
19 | 17 | const onChangeText = event => { |
20 | 18 | onChange(event.target.value); |
21 | 19 | } |
@@ -43,8 +41,6 @@ const ColorInput = forwardRef(({color, contrastColor, invalid, onChange}, ref) = |
43 | 41 | value={color} |
44 | 42 | aria-invalid={invalid} |
45 | 43 | onChange={onChangeText} |
46 | | - onFocus={() => setFocused(true)} |
47 | | - onBlur={() => setFocused(false)} |
48 | 44 | /> |
49 | 45 | <Row className={"color-selector p-0"} |
50 | 46 | style={{ |
|
0 commit comments