Skip to content
Merged
152 changes: 76 additions & 76 deletions .sync-upstream.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"description": "@rc-component/async-validator -> @v-c/async-validator"
}
],
"last_synced_commit": "b2b321766055ee9a1257f629a434906625a14557",
"last_synced_commit_short": "b2b32176",
"last_synced_at": "2026-04-14T13:45:25Z",
"last_synced_commit": "ed700385d5fdf2094c6dcad1588b3edf03ea28ee",
"last_synced_commit_short": "ed700385d5",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "v5.1.0",
"sync_count": 1
"sync_count": 2
},
{
"name": "@rc-component/cascader",
Expand All @@ -33,11 +33,11 @@
"description": "@rc-component/cascader -> @v-c/cascader"
}
],
"last_synced_commit": "261350564c311a296a0342f24f2eb3b4764ffeaa",
"last_synced_commit_short": "26135056",
"last_synced_at": "2026-04-14T13:45:25Z",
"last_synced_commit": "950b623248710cf238f7610d947a3e9ab8eda905",
"last_synced_commit_short": "950b623248",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/cascader@1.15.0",
"sync_count": 1
"sync_count": 2
},
{
"name": "@rc-component/checkbox",
Expand Down Expand Up @@ -186,11 +186,11 @@
"description": "@rc-component/input -> @v-c/input"
}
],
"last_synced_commit": "0215da50f7182c619b5a7ab206a3ef82f061fafe",
"last_synced_commit_short": "0215da50",
"last_synced_at": "2026-05-16T03:02:39Z",
"last_synced_tag": "@rc-component/input@1.3.0",
"sync_count": 2
"last_synced_commit": "cd850acf8b6ef22c2a941dc983b0ba3e23acc702",
"last_synced_commit_short": "cd850acf8b",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/input@1.3.1",
"sync_count": 3
},
{
"name": "@rc-component/input-number",
Expand Down Expand Up @@ -220,11 +220,11 @@
"description": "@rc-component/mentions -> @v-c/mentions"
}
],
"last_synced_commit": "4e54fe144c2d464470fb55eb5b4a2f0323ff368f",
"last_synced_commit_short": "4e54fe14",
"last_synced_at": "2026-04-14T13:45:25Z",
"last_synced_commit": "8a718cb96d253921f8c819ff3c95fb453ef4f0d0",
"last_synced_commit_short": "8a718cb96d",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/mentions@1.9.0",
"sync_count": 1
"sync_count": 2
},
{
"name": "@rc-component/menu",
Expand All @@ -237,11 +237,11 @@
"description": "@rc-component/menu -> @v-c/menu"
}
],
"last_synced_commit": "038c4b30e9a1482f124b71164a06467fa27df468",
"last_synced_commit_short": "038c4b30",
"last_synced_at": "2026-04-14T13:45:25Z",
"last_synced_tag": "@rc-component/menu@1.3.0",
"sync_count": 1
"last_synced_commit": "e9643ea40bf2a72e225f8998a0f2cab163ac4329",
"last_synced_commit_short": "e9643ea40b",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/menu@1.4.0",
"sync_count": 2
},
{
"name": "@rc-component/mini-decimal",
Expand All @@ -254,11 +254,11 @@
"description": "@rc-component/mini-decimal -> @v-c/mini-decimal"
}
],
"last_synced_commit": "2f43401c8809ebe6190a947839cd6d054ce5c739",
"last_synced_commit_short": "2f43401c",
"last_synced_at": "2026-05-16T08:22:17Z",
"last_synced_commit": "d9c73892ca0ec3e66f8fa761c8d2aea2ccb353d1",
"last_synced_commit_short": "d9c73892ca",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "v1.1.0",
"sync_count": 1
"sync_count": 2
},
{
"name": "@rc-component/mutate-observer",
Expand Down Expand Up @@ -322,11 +322,11 @@
"description": "@rc-component/pagination -> @v-c/pagination"
}
],
"last_synced_commit": "a85aa10168fcc137c52930b0d429b0c88587f3ee",
"last_synced_commit_short": "a85aa101",
"last_synced_at": "2026-05-16T08:22:17Z",
"last_synced_commit": "65040ce697f79d4bf4153af526f59a2f9d4a5bd2",
"last_synced_commit_short": "65040ce697",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/pagination@1.2.0",
"sync_count": 1
"sync_count": 2
},
{
"name": "@rc-component/picker",
Expand Down Expand Up @@ -356,11 +356,11 @@
"description": "@rc-component/portal -> @v-c/portal"
}
],
"last_synced_commit": "8b5c5fb1efd1c7c890c6b723d66f2d8602c7bb11",
"last_synced_commit_short": "8b5c5fb1",
"last_synced_at": "2026-05-16T08:16:37Z",
"last_synced_commit": "8a2782c3791bed8318b78997dedc6204d78ef6a6",
"last_synced_commit_short": "8a2782c379",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/portal@2.2.0",
"sync_count": 2
"sync_count": 3
},
{
"name": "@rc-component/progress",
Expand Down Expand Up @@ -390,11 +390,11 @@
"description": "@rc-component/qrcode -> @v-c/qrcode"
}
],
"last_synced_commit": "56cabfb63781a567915ceaa641236c919892c896",
"last_synced_commit_short": "56cabfb6",
"last_synced_at": "2026-04-14T13:45:25Z",
"last_synced_commit": "a79d3d61a63b62a5c4e2d3492917a9fa494a0c4d",
"last_synced_commit_short": "a79d3d61a6",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/qrcode@1.1.1",
"sync_count": 1
"sync_count": 2
},
{
"name": "@rc-component/rate",
Expand Down Expand Up @@ -458,11 +458,11 @@
"description": "@rc-component/select -> @v-c/select"
}
],
"last_synced_commit": "6fe40e33ebe6440d11612f3cd0d45a2c63f842f4",
"last_synced_commit_short": "6fe40e33",
"last_synced_at": "2026-05-16T03:02:39Z",
"last_synced_tag": "@rc-component/select@1.7.0",
"sync_count": 2
"last_synced_commit": "7876c6c2e456ef44e3bad63bf7609a0d4b1f2bc1",
"last_synced_commit_short": "7876c6c2e4",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/select@1.7.1",
"sync_count": 3
},
{
"name": "@ant-design/react-slick",
Expand Down Expand Up @@ -543,11 +543,11 @@
"description": "@rc-component/table -> @v-c/table"
}
],
"last_synced_commit": "d5b5bb1a7c1587281482808203e456959fdae7d7",
"last_synced_commit_short": "d5b5bb1a",
"last_synced_at": "2026-05-16T03:02:39Z",
"last_synced_tag": "@rc-component/table@1.10.0",
"sync_count": 2
"last_synced_commit": "b611eb2623f4891a4ff4dc7a27a1305425196fb8",
"last_synced_commit_short": "b611eb2623",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/table@1.10.2",
"sync_count": 3
},
{
"name": "@rc-component/tabs",
Expand All @@ -560,11 +560,11 @@
"description": "@rc-component/tabs -> @v-c/tabs"
}
],
"last_synced_commit": "3732bf57df149c67f4ac394e4b0a302d855d15ed",
"last_synced_commit_short": "3732bf57",
"last_synced_at": "2026-04-14T13:45:25Z",
"last_synced_commit": "926f67ec60cfa5d5672e03ec22ecf7e87f8aa806",
"last_synced_commit_short": "926f67ec60",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/tabs@1.9.0",
"sync_count": 1
"sync_count": 2
},
{
"name": "@rc-component/textarea",
Expand Down Expand Up @@ -628,11 +628,11 @@
"description": "@rc-component/tree -> @v-c/tree"
}
],
"last_synced_commit": "1f049b29e831b13159cf78233a570d4628b88613",
"last_synced_commit_short": "1f049b29",
"last_synced_at": "2026-05-16T08:16:37Z",
"last_synced_tag": "@rc-component/tree@1.3.1",
"sync_count": 2
"last_synced_commit": "468177253aaf4188d6c9e6063bd62f008dbae2aa",
"last_synced_commit_short": "468177253a",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/tree@1.3.2",
"sync_count": 3
},
{
"name": "@rc-component/tree-select",
Expand Down Expand Up @@ -662,11 +662,11 @@
"description": "@rc-component/trigger -> @v-c/trigger"
}
],
"last_synced_commit": "59b659da4aad1f073d7783b1bfd907ee0ccbed65",
"last_synced_commit_short": "59b659da",
"last_synced_at": "2026-04-14T13:45:25Z",
"last_synced_tag": "@rc-component/trigger@3.9.0",
"sync_count": 1
"last_synced_commit": "220358ddee26e8b00e97a6b06dadd5612e53066b",
"last_synced_commit_short": "220358ddee",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/trigger@3.9.1",
"sync_count": 2
},
{
"name": "@rc-component/upload",
Expand All @@ -679,11 +679,11 @@
"description": "@rc-component/upload -> @v-c/upload"
}
],
"last_synced_commit": "799024c144e82b32ba3c57ecccbf74b73fcf0021",
"last_synced_commit_short": "799024c1",
"last_synced_at": "2026-05-16T08:16:37Z",
"last_synced_tag": "@rc-component/upload@1.1.0",
"sync_count": 2
"last_synced_commit": "d53036dbfab8b2efca4942a7f8c76d15fbdcafc5",
"last_synced_commit_short": "d53036dbfa",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/upload@1.1.1",
"sync_count": 3
},
{
"name": "@rc-component/util",
Expand All @@ -696,11 +696,11 @@
"description": "@rc-component/util -> @v-c/util"
}
],
"last_synced_commit": "6dba3e18057cc33cd3e2347de0f8e07c186d0b43",
"last_synced_commit_short": "6dba3e18",
"last_synced_at": "2026-05-16T08:21:19Z",
"last_synced_commit": "b7731c336e96580dd9af44b4e5c98161c77950f9",
"last_synced_commit_short": "b7731c336e",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/util@1.10.0",
"sync_count": 2
"sync_count": 3
},
{
"name": "@rc-component/virtual-list",
Expand All @@ -713,11 +713,11 @@
"description": "@rc-component/virtual-list -> @v-c/virtual-list"
}
],
"last_synced_commit": "402e156e4a7c9152e3f6db98572afff8acd28b66",
"last_synced_commit_short": "402e156e",
"last_synced_at": "2026-04-14T13:45:25Z",
"last_synced_tag": "@rc-component/virtual-list@1.0.1",
"sync_count": 1
"last_synced_commit": "2e032d44fac868a86b1e3eabc6c16f3ef2545868",
"last_synced_commit_short": "2e032d44fa",
"last_synced_at": "2026-06-02T09:19:58Z",
"last_synced_tag": "@rc-component/virtual-list@1.2.0",
"sync_count": 2
}
]
}
2 changes: 1 addition & 1 deletion packages/input/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@v-c/input",
"type": "module",
"version": "1.1.0",
"version": "1.1.1",
"description": "",
"publishConfig": {
"access": "public"
Expand Down
35 changes: 28 additions & 7 deletions packages/input/src/utils/commonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,19 @@ function createPatchedTarget<
return patched
}

function cloneEvent<
function buildSafeEvent<
EventType extends Event,
Element extends HTMLInputElement | HTMLTextAreaElement,
>(event: EventType, target: Element, value: any): EventType {
const patchedTarget = createPatchedTarget(target, value)

>(event: EventType, target: Element): EventType {
const safeEvent: any = {
type: (event as any)?.type,
timeStamp: (event as any)?.timeStamp,
bubbles: (event as any)?.bubbles,
cancelable: (event as any)?.cancelable,
composed: (event as any)?.composed,

target: patchedTarget,
currentTarget: patchedTarget,
target,
currentTarget: target,

preventDefault: (event as any)?.preventDefault
? (event as any).preventDefault.bind(event)
Expand All @@ -52,6 +50,24 @@ function cloneEvent<
return safeEvent as EventType
}

// 需要修改 value 时,克隆一个带有新 value 的 target(detached),避免污染真实节点
function cloneEvent<
EventType extends Event,
Element extends HTMLInputElement | HTMLTextAreaElement,
>(event: EventType, target: Element, value: any): EventType {
const patchedTarget = createPatchedTarget(target, value)
return buildSafeEvent(event, patchedTarget)
}

// value 无需修改时,保持真实 target 挂载,避免使用 detached clone
// https://github.com/react-component/input/pull/175
function cloneEventWithTarget<
EventType extends Event,
Element extends HTMLInputElement | HTMLTextAreaElement,
>(event: EventType, target: Element): EventType {
return buildSafeEvent(event, target)
}

export function hasAddon(props: BaseInputProps | InputProps) {
return !!(props.addonBefore || props.addonAfter)
}
Expand All @@ -75,7 +91,12 @@ export function resolveOnChange<E extends HTMLInputElement | HTMLTextAreaElement
}

if (target.type !== 'file' && targetValue !== undefined) {
onChange(cloneEvent(e as any, target, targetValue))
if (target.value !== targetValue) {
onChange(cloneEvent(e as any, target, targetValue))
}
else {
onChange(cloneEventWithTarget(e as any, target))
}
return
}

Expand Down
2 changes: 1 addition & 1 deletion packages/menu/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@v-c/menu",
"type": "module",
"version": "1.1.0",
"version": "1.1.1",
"description": "menu ui component for vue",
"exports": {
".": {
Expand Down
Loading