From 7c7b4163d90b41cf1361bf37cfcaafb00a3ad3d4 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sun, 23 Feb 2020 13:03:30 +0800 Subject: [PATCH] fix: input clear icon event --- build/config.js | 2 +- components/input/Input.jsx | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/config.js b/build/config.js index a7602110d..a75a866b4 100644 --- a/build/config.js +++ b/build/config.js @@ -1,5 +1,5 @@ module.exports = { dev: { - componentName: 'statistic', // dev components + componentName: 'input', // dev components }, }; diff --git a/components/input/Input.jsx b/components/input/Input.jsx index 33aed8ec9..72e3c5ade 100644 --- a/components/input/Input.jsx +++ b/components/input/Input.jsx @@ -20,7 +20,13 @@ export function resolveOnChange(target, e, onChange) { let event = e; if (e.type === 'click') { // click clear icon - event = { ...e }; + //event = Object.create(e); + Object.defineProperty(event, 'target', { + writable: true, + }); + Object.defineProperty(event, 'currentTarget', { + writable: true, + }); event.target = target; event.currentTarget = target; const originalInputValue = target.value;