@antscorp/antsomi-ui 1.3.5-beta.409 → 1.3.5-beta.410
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.
|
@@ -37,6 +37,24 @@ export const EditableName = React.forwardRef((props, ref) => {
|
|
|
37
37
|
spanRef.current.innerText = value || defaultValue.current || '';
|
|
38
38
|
setInputWidth(((_a = spanRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 1);
|
|
39
39
|
}, [value, componentInView]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
var _a;
|
|
42
|
+
/**
|
|
43
|
+
* This effect prevent horizontal wheel when don't focus input element (chromium kernel bug)
|
|
44
|
+
* NOTE: issue link: https://issues.chromium.org/issues/41245282
|
|
45
|
+
*/
|
|
46
|
+
if (!inputRef.current)
|
|
47
|
+
return;
|
|
48
|
+
const inputRefElement = inputRef.current;
|
|
49
|
+
const preventWheel = e => {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
};
|
|
52
|
+
(_a = inputRefElement.input) === null || _a === void 0 ? void 0 : _a.addEventListener('wheel', preventWheel, { passive: false });
|
|
53
|
+
return () => {
|
|
54
|
+
var _a;
|
|
55
|
+
(_a = inputRefElement === null || inputRefElement === void 0 ? void 0 : inputRefElement.input) === null || _a === void 0 ? void 0 : _a.removeEventListener('wheel', preventWheel);
|
|
56
|
+
};
|
|
57
|
+
}, []);
|
|
40
58
|
return (React.createElement(InputWrapperStyled, { className: className || '', style: style, ref: componentInViewRef },
|
|
41
59
|
React.createElement(Tooltip, { title: value || internalValue },
|
|
42
60
|
React.createElement(Input, { readOnly: readonly, ref: inputRef, style: { width: inputWidth + 2 }, defaultValue: defaultValue.current, value: value, onChange: event => {
|