Attach empty onclick listener to each node

Fixes #1169.

This is a more robust way of fixing what MobileSafariClickPlugin previously tried to. Now even if you don't want anything to do with touch events, click events still work properly.

Test Plan: Added a click handler to an `<img />` element and triggered it in the iOS simulator -- it didn't execute before.
This commit is contained in:
Ben Alpert committed 2014-05-27 13:40:17 -07:00
1 parent c913c95908
commit e096000bb5
6 files changed
+67 -67

No files matched your search

@@ -343,6 +343,26 @@ describe('ReactDOMComponent', function() {
'properties to values, not a string.'
);
});
it("should execute custom event plugin listening behavior", function() {
var React = require('React');
var SimpleEventPlugin = require('SimpleEventPlugin');
SimpleEventPlugin.didPutListener = mocks.getMockFunction();
SimpleEventPlugin.willDeleteListener = mocks.getMockFunction();
var container = document.createElement('div');
React.renderComponent(
<div onClick={() => true} />,
container
);
expect(SimpleEventPlugin.didPutListener.mock.calls.length).toBe(1);
React.unmountComponentAtNode(container);
expect(SimpleEventPlugin.willDeleteListener.mock.calls.length).toBe(1);
});
});
describe('updateComponent', function() {