Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Safari onClick hack into ReactDOMComponent #8189

Merged
merged 1 commit into from
Nov 3, 2016

Conversation

sebmarkbage
Copy link
Collaborator

This is already where we trap non-bubbling events. We also already branch on the tag type so we know if it is interactive or not.

This will let us get rid of the didPutListener and willDeleteListener abstractions.

I use a simple onclick = emptyFunction to avoid the need for a bookkeeping map.

Is it critical to unsubscribe from this when the listener is removed?

This is already where we trap non-bubbling events. We also already branch
on the tag type so we know if it is interactive or not.

This will let us get rid of the didPutListener and willDeleteListener
abstractions.

I use a simple onclick = emptyFunction to avoid the need for a bookkeeping
map.
@@ -911,6 +933,15 @@ ReactDOMComponent.Mixin = {
lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
break;
default:
if (typeof lastProps.onClick !== 'function' &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better to swap these so that the more restrictive condition comes first?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think it matters.

@sebmarkbage sebmarkbage merged commit b20e3af into facebook:master Nov 3, 2016
acusti pushed a commit to brandcast/react that referenced this pull request Mar 15, 2017
This is already where we trap non-bubbling events. We also already branch
on the tag type so we know if it is interactive or not.

This will let us get rid of the didPutListener and willDeleteListener
abstractions.

I use a simple onclick = emptyFunction to avoid the need for a bookkeeping
map.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants