From 4ce1fb0b3d88fe24c5072bf0bcdb92691895478f Mon Sep 17 00:00:00 2001 From: landvibe Date: Sat, 14 Oct 2017 19:47:55 +0900 Subject: [PATCH 1/6] fixed a bug on radio input https://github.com/facebook/react/issues/7630 --- .../dom/fiber/ReactDOMFiberComponent.js | 34 ++++++++-------- .../wrappers/__tests__/ReactDOMInput-test.js | 39 +++++++++++++++++++ 2 files changed, 55 insertions(+), 18 deletions(-) diff --git a/src/renderers/dom/fiber/ReactDOMFiberComponent.js b/src/renderers/dom/fiber/ReactDOMFiberComponent.js index a98800329222b..c02364eaea5e6 100644 --- a/src/renderers/dom/fiber/ReactDOMFiberComponent.js +++ b/src/renderers/dom/fiber/ReactDOMFiberComponent.js @@ -810,23 +810,11 @@ var ReactDOMFiberComponent = { lastRawProps: Object, nextRawProps: Object, ): void { - var wasCustomComponentTag = isCustomComponent(tag, lastRawProps); - var isCustomComponentTag = isCustomComponent(tag, nextRawProps); - // Apply the diff. - updateDOMProperties( - domElement, - updatePayload, - wasCustomComponentTag, - isCustomComponentTag, - ); - // TODO: Ensure that an update gets scheduled if any of the special props // changed. switch (tag) { case 'input': - // Update the wrapper around inputs *after* updating props. This has to - // happen after `updateDOMProperties`. Otherwise HTML5 input validations - // raise warnings and prevent the new value from being assigned. + // Update the wrapper around inputs *after* updating props. ReactDOMFiberInput.updateWrapper(domElement, nextRawProps); // We also check that we haven't missed a value update, such as a @@ -836,11 +824,21 @@ var ReactDOMFiberComponent = { case 'textarea': ReactDOMFiberTextarea.updateWrapper(domElement, nextRawProps); break; - case 'select': - // value update needs to occur after