Skip to content

Commit 76a0d31

Browse files
[UIK-3527][color-picker] fixed some color-picker issues (#2547)
<!--- Provide a general summary of your changes in the Title above --> ## Motivation and Context Fixed UIK-3526, UIK-3527 and UIK-2865 <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## How has this been tested? Manually <!--- Please describe in detail how you tested your changes. --> <!--- For example: --> <!--- I have added unit tests --> <!--- I have added Voice Over tests --> <!--- Code cannot be tested automatically so I have tested it only manually --> ## Screenshots (if appropriate): ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [X] Bug fix (non-breaking change which fixes an issue). - [ ] New feature (non-breaking change which adds functionality). - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). - [ ] Nice improve. ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] I have updated the documentation accordingly. - [X] I have added changelog note to corresponding `CHANGELOG.md` file with planned publish date. - [ ] I have added new tests on added of fixed functionality. --------- Signed-off-by: ilyabrower <[email protected]> Co-authored-by: Valeria-Zimnitskaya <[email protected]>
1 parent f1df2a7 commit 76a0d31

16 files changed

+29
-33
lines changed

semcore/color-picker/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
44

5-
65
## [16.1.12] - 2025-11-10
76

87
### Fixed
98

109
- Issue with `svg` in `ColorPicker.Trigger` and `ColorPicker.Item`.
10+
- `size` property didn't apply for the `PaletteManager.InputColor`.
11+
- Incorrect types for `PaletteManager`.
12+
- Validation issues in `PaletteManager.InputColor`.
1113

1214
## [16.1.11] - 2025-10-29
1315

semcore/color-picker/__tests__/color-picker.axe-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test.describe(`@color-picker ${TAG.ACCESSIBILITY}`, () => {
3838
});
3939

4040
test('Input validation', async ({ page }) => {
41-
await loadPage(page, 'stories/components/color-picker/docs/examples/input_validation.tsx', 'en');
41+
await loadPage(page, 'stories/components/color-picker/tests/examples/input_validation.tsx', 'en');
4242

4343
await page.locator('[data-ui-name="ColorPicker.Trigger"]').click();
4444
const input = page.locator('input[data-ui-name="PaletteManager.InputColor"]');

semcore/color-picker/__tests__/color-picker.browser-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ test.describe(`${TAG.FUNCTIONAL}`, () => {
596596
await locators.clearColor(page).click();
597597
await expect(locators.inputColor(page)).toBeFocused();
598598
await expect(locators.palette(page)).toBeEmpty();
599-
await expect(locators.inputColor(page)).toHaveAttribute('aria-invalid', 'true');
599+
await expect(locators.inputColor(page)).toHaveAttribute('aria-invalid', 'false');
600600
await expect(locators.inputColor(page)).toBeEmpty();
601601

602602
await locators.inputColor(page).fill('999');
Loading
Loading
Loading
Loading
Loading
Loading

semcore/color-picker/src/components/InputColor.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Box } from '@semcore/flex-box';
33
import CheckM from '@semcore/icon/Check/m';
44
import CloseM from '@semcore/icon/Close/m';
55
import Input from '@semcore/input';
6+
import type { InputSize } from '@semcore/input';
67
import React from 'react';
78

89
import style from '../style/color-picker.shadow.css';
@@ -18,6 +19,7 @@ type InputColorAsProps = {
1819
focus?: boolean;
1920
Children: any;
2021
getI18nText: (messageId: string, values?: { [key: string]: string | number }) => string;
22+
size?: InputSize;
2123
};
2224

2325
function isValidHex(hex: string) {
@@ -69,6 +71,7 @@ class InputColorRoot extends Component<InputColorAsProps> {
6971

7072
handlerCancel = (event: React.MouseEvent) => {
7173
this.handlers.value('', event);
74+
this.handlers.state('normal');
7275
};
7376

7477
handlerChange = debounce((value: string) => {
@@ -91,7 +94,7 @@ class InputColorRoot extends Component<InputColorAsProps> {
9194
};
9295

9396
render() {
94-
const { styles, state, value, onFocus, onBlur, focus, getI18nText } = this.asProps;
97+
const { styles, state, value, onFocus, onBlur, focus, getI18nText, size } = this.asProps;
9598

9699
const SPaletteManager = Box;
97100
const SInputValue = Root;
@@ -108,7 +111,7 @@ class InputColorRoot extends Component<InputColorAsProps> {
108111
<SInputContainer>
109112
<span aria-hidden='true'>#</span>
110113
<SInput>
111-
<Input ml={1} w={135} state={state} onKeyDown={this.handlekeyDown}>
114+
<Input ml={1} w={135} state={state} size={size} onKeyDown={this.handlekeyDown}>
112115
<SInputValue
113116
render={Input.Value}
114117
placeholder='FFFFFF'

0 commit comments

Comments
 (0)