antd-mobile 5.42.2-alpha.0 → 5.42.2-alpha.1
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/2x/bundle/antd-mobile.cjs.development.js +13 -6
- package/2x/bundle/antd-mobile.cjs.js +4 -4
- package/2x/bundle/antd-mobile.es.development.js +13 -6
- package/2x/bundle/antd-mobile.es.js +372 -372
- package/2x/bundle/antd-mobile.umd.development.js +13 -6
- package/2x/bundle/antd-mobile.umd.js +4 -4
- package/2x/cjs/components/virtual-input/use-click-outside.d.ts +1 -1
- package/2x/cjs/components/virtual-input/use-click-outside.js +10 -4
- package/2x/cjs/components/virtual-input/virtual-input.js +11 -3
- package/2x/es/components/virtual-input/use-click-outside.d.ts +1 -1
- package/2x/es/components/virtual-input/use-click-outside.js +10 -4
- package/2x/es/components/virtual-input/virtual-input.js +11 -3
- package/2x/package.json +1 -1
- package/bundle/antd-mobile.cjs.development.js +13 -6
- package/bundle/antd-mobile.cjs.js +4 -4
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +13 -6
- package/bundle/antd-mobile.es.js +372 -372
- package/bundle/antd-mobile.umd.development.js +13 -6
- package/bundle/antd-mobile.umd.js +4 -4
- package/cjs/components/virtual-input/use-click-outside.d.ts +1 -1
- package/cjs/components/virtual-input/use-click-outside.js +10 -4
- package/cjs/components/virtual-input/virtual-input.js +11 -3
- package/es/components/virtual-input/use-click-outside.d.ts +1 -1
- package/es/components/virtual-input/use-click-outside.js +10 -4
- package/es/components/virtual-input/virtual-input.js +11 -3
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -27604,7 +27604,7 @@ const Multiple = (p) => {
|
|
|
27604
27604
|
const index = attachPropertiesToComponent(TreeSelect, {
|
|
27605
27605
|
Multiple
|
|
27606
27606
|
});
|
|
27607
|
-
function useClickOutside(handler, ref2) {
|
|
27607
|
+
function useClickOutside(handler, ref2, hasKeyboardProps = false) {
|
|
27608
27608
|
React$3.useEffect(() => {
|
|
27609
27609
|
function handleClick(event) {
|
|
27610
27610
|
if (!ref2.current || ref2.current.contains(event.target)) {
|
|
@@ -27612,9 +27612,9 @@ function useClickOutside(handler, ref2) {
|
|
|
27612
27612
|
}
|
|
27613
27613
|
handler(event);
|
|
27614
27614
|
}
|
|
27615
|
-
document.addEventListener("click", handleClick, true);
|
|
27615
|
+
document.addEventListener("click", handleClick, hasKeyboardProps ? true : false);
|
|
27616
27616
|
return () => {
|
|
27617
|
-
document.removeEventListener("click", handleClick, true);
|
|
27617
|
+
document.removeEventListener("click", handleClick, hasKeyboardProps ? true : false);
|
|
27618
27618
|
};
|
|
27619
27619
|
}, [handler, ref2]);
|
|
27620
27620
|
}
|
|
@@ -27702,7 +27702,7 @@ const VirtualInput = React$3.forwardRef((props, ref2) => {
|
|
|
27702
27702
|
}
|
|
27703
27703
|
useClickOutside(() => {
|
|
27704
27704
|
setBlur();
|
|
27705
|
-
}, rootRef);
|
|
27705
|
+
}, rootRef, !!mergedProps.keyboard);
|
|
27706
27706
|
const keyboard = mergedProps.keyboard;
|
|
27707
27707
|
const keyboardElement = keyboard && React$3.cloneElement(keyboard, {
|
|
27708
27708
|
onInput: (v) => {
|
|
@@ -27729,14 +27729,21 @@ const VirtualInput = React$3.forwardRef((props, ref2) => {
|
|
|
27729
27729
|
},
|
|
27730
27730
|
visible: hasFocus,
|
|
27731
27731
|
onClose: () => {
|
|
27732
|
-
var _a, _b;
|
|
27732
|
+
var _a, _b, _c;
|
|
27733
|
+
const activeElement = document.activeElement;
|
|
27734
|
+
if (activeElement === contentRef.current) {
|
|
27735
|
+
(_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
27736
|
+
}
|
|
27733
27737
|
setBlur();
|
|
27734
|
-
(
|
|
27738
|
+
(_c = (_b = keyboard.props).onClose) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
27735
27739
|
},
|
|
27736
27740
|
getContainer: null
|
|
27737
27741
|
});
|
|
27738
27742
|
const setCaretPositionToEnd = (e2) => {
|
|
27739
27743
|
var _a, _b, _c;
|
|
27744
|
+
if (mergedProps.disabled) {
|
|
27745
|
+
return;
|
|
27746
|
+
}
|
|
27740
27747
|
if (caretPosition !== value.length) {
|
|
27741
27748
|
setCaretPosition(value.length);
|
|
27742
27749
|
(_b = (_a = mergedProps.cursor) === null || _a === void 0 ? void 0 : _a.onMove) === null || _b === void 0 ? void 0 : _b.call(_a, value.length);
|