Skip to content

Commit

Permalink
Handle special properties like onFocusOut
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Aug 7, 2017
1 parent 8c2eeab commit 019de2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ if (__DEV__) {
var EVENT_NAME_REGEX = /^on[A-Z]/;
var ARIA_NAME_REGEX = /^aria-/i;
var possibleStandardNames = require('possibleStandardNames');
var unsupportedProps = {
onfocusin: true,
onfocusout: true,
};

var validateProperty = function(tagName, name, value, debugID) {
if (warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
Expand Down Expand Up @@ -78,7 +82,8 @@ if (__DEV__) {
return true;
}

if (DOMProperty.isReservedProp(name)) {
// Unsupported props are handled by another validation
if (unsupportedProps.hasOwnProperty(lowerCasedName)) {
return true;
}

Expand Down
5 changes: 4 additions & 1 deletion src/renderers/dom/shared/hooks/possibleStandardNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ var possibleStandardNames = {
class: 'className',
classid: 'classID',
classname: 'className',
children: 'children',
colspan: 'colSpan',
contenteditable: 'contentEditable',
contextmenu: 'contextMenu',
controlslist: 'controlsList',
crossorigin: 'crossOrigin',
dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
datetime: 'dateTime',
defaultvalue: 'defaultValue',
defaultchecked: 'defaultChecked',
Expand Down Expand Up @@ -81,7 +83,7 @@ var possibleStandardNames = {
alignmentbaseline: 'alignmentBaseline',
'alignment-baseline': 'alignmentBaseline',
allowreorder: 'allowReorder',
'aribic-form': 'arabicForm',
'arabic-form': 'arabicForm',
arabicform: 'arabicForm',
attributename: 'attributeName',
attributetype: 'attributeType',
Expand Down Expand Up @@ -233,6 +235,7 @@ var possibleStandardNames = {
'stroke-opacity': 'strokeOpacity',
strokeopacity: 'strokeOpacity',
'stroke-width': 'strokeWidth',
suppresscontenteditablewarning: 'suppressContentEditableWarning',
surfacescale: 'surfaceScale',
systemlanguage: 'systemLanguage',
tablevalues: 'tableValues',
Expand Down

0 comments on commit 019de2b

Please sign in to comment.