@@ -30,7 +30,6 @@ export const REACT_ELEMENT_TYPE = Symbol.for('react.element');
3030
3131const CAMEL_PROPS =
3232 / ^ (?: a c c e n t | a l i g n m e n t | a r a b i c | b a s e l i n e | c a p | c l i p (? ! P a t h U ) | c o l o r | d o m i n a n t | f i l l | f l o o d | f o n t | g l y p h (? ! R ) | h o r i z | i m a g e ( ! S ) | l e t t e r | l i g h t i n g | m a r k e r (? ! H | W | U ) | o v e r l i n e | p a i n t | p o i n t e r | s h a p e | s t o p | s t r i k e t h r o u g h | s t r o k e | t e x t (? ! L ) | t r a n s f o r m | u n d e r l i n e | u n i c o d e | u n i t s | v | v e c t o r | v e r t | w o r d | w r i t i n g | x (? ! C ) ) [ A - Z ] / ;
33- const ON_ANI = / ^ o n ( A n i | T r a | T o u | B e f o r e I n p | C o m p o ) / ;
3433const CAMEL_REPLACE = / [ A - Z 0 - 9 ] / g;
3534const IS_DOM = typeof document !== 'undefined' ;
3635
@@ -143,7 +142,6 @@ function handleDomVNode(vnode) {
143142 continue ;
144143 }
145144
146- let lowerCased = i . toLowerCase ( ) ;
147145 if ( i === 'style' && typeof value === 'object' ) {
148146 for ( let key in value ) {
149147 if ( typeof value [ key ] === 'number' && ! IS_NON_DIMENSIONAL . test ( key ) ) {
@@ -165,9 +163,10 @@ function handleDomVNode(vnode) {
165163 // value will be used as the file name and the file will be called
166164 // "true" upon downloading it.
167165 value = '' ;
168- } else if ( lowerCased === 'translate' && value === 'no' ) {
166+ } else if ( i === 'translate' && value === 'no' ) {
169167 value = false ;
170- } else if ( lowerCased [ 0 ] === 'o' && lowerCased [ 1 ] === 'n' ) {
168+ } else if ( i [ 0 ] === 'o' && i [ 1 ] === 'n' ) {
169+ let lowerCased = i . toLowerCase ( ) ;
171170 if ( lowerCased === 'ondoubleclick' ) {
172171 i = 'ondblclick' ;
173172 } else if (
@@ -180,24 +179,22 @@ function handleDomVNode(vnode) {
180179 i = 'onfocusin' ;
181180 } else if ( lowerCased === 'onblur' ) {
182181 i = 'onfocusout' ;
183- } else if ( ON_ANI . test ( i ) ) {
182+ }
183+
184+ // Add support for onInput and onChange, see #3561
185+ // if we have an oninput prop already change it to oninputCapture
186+ if ( lowerCased === 'oninput' ) {
184187 i = lowerCased ;
188+ if ( normalizedProps [ i ] ) {
189+ i = 'oninputCapture' ;
190+ }
185191 }
186192 } else if ( isNonDashedType && CAMEL_PROPS . test ( i ) ) {
187193 i = i . replace ( CAMEL_REPLACE , '-$&' ) . toLowerCase ( ) ;
188194 } else if ( value === null ) {
189195 value = undefined ;
190196 }
191197
192- // Add support for onInput and onChange, see #3561
193- // if we have an oninput prop already change it to oninputCapture
194- if ( lowerCased === 'oninput' ) {
195- i = lowerCased ;
196- if ( normalizedProps [ i ] ) {
197- i = 'oninputCapture' ;
198- }
199- }
200-
201198 normalizedProps [ i ] = value ;
202199 }
203200
0 commit comments