mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
Added more specific warning for using onDblClick instead of onDoubleClick (#6881)
This commit is contained in:
@@ -163,6 +163,17 @@ describe('ReactDOMComponent', function() {
|
||||
);
|
||||
});
|
||||
|
||||
it('should warn for onDblClick prop', function() {
|
||||
spyOn(console, 'error');
|
||||
var container = document.createElement('div');
|
||||
ReactDOM.render(<div onDblClick={() => {}} />, container);
|
||||
expect(console.error.calls.count(0)).toBe(1);
|
||||
expect(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe(
|
||||
'Warning: Unknown event handler property onDblClick. Did you mean `onDoubleClick`?\n in div (at **)'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
it('should warn about styles with numeric string values for non-unitless properties', function() {
|
||||
spyOn(console, 'error');
|
||||
|
||||
|
||||
@@ -132,6 +132,11 @@ function publishRegistrationName(registrationName, PluginModule, eventName) {
|
||||
var lowerCasedName = registrationName.toLowerCase();
|
||||
EventPluginRegistry.possibleRegistrationNames[lowerCasedName] =
|
||||
registrationName;
|
||||
|
||||
|
||||
if (registrationName === 'onDoubleClick') {
|
||||
EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user