@cloud-ru/ds-fields 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/components/FieldTextArea/FieldTextArea.js +5 -0
- package/dist/esm/components/FieldTextArea/FieldTextArea.js +6 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/components/FieldTextArea/FieldTextArea.tsx +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.0.3 (2026-08-20)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **FF-8679:** stabilize textarea initial height ([eec63a6](https://github.com/cloud-ru-tech/snack-v2/commit/eec63a6f1dc6135c9b882b7d1e24ae4799a8e684))
|
|
11
|
+
|
|
6
12
|
## 1.0.2 (2026-08-20)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
@@ -24,6 +24,11 @@ exports.FieldTextArea = (0, react_1.forwardRef)(function FieldTextArea({ label =
|
|
|
24
24
|
const copyButtonRef = (0, react_1.useRef)(null);
|
|
25
25
|
const [focusVisible, setFocusVisible] = (0, react_1.useState)(false);
|
|
26
26
|
const [hover, setHover] = (0, react_1.useState)(false);
|
|
27
|
+
// autosize меряет высоту до того, как ThemeScope навесит классы темы — пересчитываем после mount.
|
|
28
|
+
const [, remeasure] = (0, react_1.useReducer)((tick) => tick + 1, 0);
|
|
29
|
+
(0, react_1.useEffect)(() => {
|
|
30
|
+
remeasure();
|
|
31
|
+
}, []);
|
|
27
32
|
const resolvedAutoFocus = (0, hooks_1.useAdaptiveAutoFocus)(autoFocus, layoutPresets);
|
|
28
33
|
// controlled/uncontrolled: useValueControl держит внутреннее состояние при отсутствии `value`,
|
|
29
34
|
// событие в `onChange` пробрасываем сами (useValueControl передаёт только значение).
|
|
@@ -5,7 +5,7 @@ import { BAR_HIDE_STRATEGY, RESIZE, Scroll, SIZE as SCROLL_SIZE } from '@cloud-r
|
|
|
5
5
|
import { extractSupportProps, useValueControl } from '@cloud-ru/ds-utils';
|
|
6
6
|
import cn from 'classnames';
|
|
7
7
|
import mergeRefs from 'merge-refs';
|
|
8
|
-
import { forwardRef, useCallback, useMemo, useRef, useState, } from 'react';
|
|
8
|
+
import { forwardRef, useCallback, useEffect, useMemo, useReducer, useRef, useState, } from 'react';
|
|
9
9
|
import TextareaAutosize from 'react-textarea-autosize';
|
|
10
10
|
import { TEST_IDS } from '../../constants.js';
|
|
11
11
|
import { useAdaptiveAutoFocus } from '../../hooks/index.js';
|
|
@@ -18,6 +18,11 @@ export const FieldTextArea = forwardRef(function FieldTextArea({ label = '', lab
|
|
|
18
18
|
const copyButtonRef = useRef(null);
|
|
19
19
|
const [focusVisible, setFocusVisible] = useState(false);
|
|
20
20
|
const [hover, setHover] = useState(false);
|
|
21
|
+
// autosize меряет высоту до того, как ThemeScope навесит классы темы — пересчитываем после mount.
|
|
22
|
+
const [, remeasure] = useReducer((tick) => tick + 1, 0);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
remeasure();
|
|
25
|
+
}, []);
|
|
21
26
|
const resolvedAutoFocus = useAdaptiveAutoFocus(autoFocus, layoutPresets);
|
|
22
27
|
// controlled/uncontrolled: useValueControl держит внутреннее состояние при отсутствии `value`,
|
|
23
28
|
// событие в `onChange` пробрасываем сами (useValueControl передаёт только значение).
|