@oliasoft-open-source/react-ui-library 4.15.5 → 4.15.6-beta-2
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/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9096,6 +9096,17 @@ const Input$1 = forwardRef(
|
|
|
9096
9096
|
//use width instead
|
|
9097
9097
|
}, ref2) => {
|
|
9098
9098
|
const disabledContext = useContext(DisabledContext);
|
|
9099
|
+
const inputRef = useRef(null);
|
|
9100
|
+
const handleChange = (e2) => {
|
|
9101
|
+
const cursorPosition = e2.target.selectionStart;
|
|
9102
|
+
onChange(e2);
|
|
9103
|
+
setTimeout(() => {
|
|
9104
|
+
if (inputRef.current && cursorPosition !== null) {
|
|
9105
|
+
inputRef.current.selectionStart = cursorPosition;
|
|
9106
|
+
inputRef.current.selectionEnd = cursorPosition;
|
|
9107
|
+
}
|
|
9108
|
+
}, 0);
|
|
9109
|
+
};
|
|
9099
9110
|
const order2 = (() => {
|
|
9100
9111
|
if (groupOrder) {
|
|
9101
9112
|
switch (groupOrder) {
|
|
@@ -9123,12 +9134,12 @@ const Input$1 = forwardRef(
|
|
|
9123
9134
|
children: /* @__PURE__ */ jsx(
|
|
9124
9135
|
"input",
|
|
9125
9136
|
{
|
|
9126
|
-
ref: ref2,
|
|
9137
|
+
ref: ref2 || inputRef,
|
|
9127
9138
|
type: type || "text",
|
|
9128
9139
|
size: size2 || 20,
|
|
9129
9140
|
placeholder: placeholder3 ?? "",
|
|
9130
9141
|
value: value ?? "",
|
|
9131
|
-
onChange,
|
|
9142
|
+
onChange: handleChange,
|
|
9132
9143
|
onKeyPress,
|
|
9133
9144
|
onFocus,
|
|
9134
9145
|
onBlur,
|
|
@@ -56787,9 +56798,21 @@ const TextArea = ({
|
|
|
56787
56798
|
testId
|
|
56788
56799
|
}) => {
|
|
56789
56800
|
const disabledContext = useContext(DisabledContext);
|
|
56801
|
+
const textareaRef = useRef(null);
|
|
56802
|
+
const handleChange = (e2) => {
|
|
56803
|
+
const cursorPosition = e2.target.selectionStart;
|
|
56804
|
+
onChange(e2);
|
|
56805
|
+
setTimeout(() => {
|
|
56806
|
+
if (textareaRef.current && cursorPosition !== null) {
|
|
56807
|
+
textareaRef.current.selectionStart = cursorPosition;
|
|
56808
|
+
textareaRef.current.selectionEnd = cursorPosition;
|
|
56809
|
+
}
|
|
56810
|
+
}, 0);
|
|
56811
|
+
};
|
|
56790
56812
|
const textarea2 = /* @__PURE__ */ jsx(
|
|
56791
56813
|
"textarea",
|
|
56792
56814
|
{
|
|
56815
|
+
ref: textareaRef,
|
|
56793
56816
|
className: cx$2(
|
|
56794
56817
|
styles$5.textarea,
|
|
56795
56818
|
error2 ? styles$5.error : "",
|
|
@@ -56801,7 +56824,7 @@ const TextArea = ({
|
|
|
56801
56824
|
placeholder: placeholder3,
|
|
56802
56825
|
cols,
|
|
56803
56826
|
rows,
|
|
56804
|
-
onChange,
|
|
56827
|
+
onChange: handleChange,
|
|
56805
56828
|
disabled: disabled2 || disabledContext,
|
|
56806
56829
|
onKeyPress,
|
|
56807
56830
|
onFocus,
|