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

Attributes on custom elements are not removed during the diff #6747

Closed
grassator opened this issue May 11, 2016 · 0 comments
Closed

Attributes on custom elements are not removed during the diff #6747

grassator opened this issue May 11, 2016 · 0 comments

Comments

@grassator
Copy link
Contributor

We are trying to adopt custom elements for some parts of your UI and ran into the issue that during an update to the tree, custom attributes on the the custom elements are not removed correctly as can be seen here: http://jsbin.com/ferohipaje/edit?html,output (you will need to click on "false" and then inspect the DOM node in the dev tools of the browser).

I've tracked the issue to the _updateDOMProperties method in ReactDOMComponent.js. It seems that there is a special check in the loop for nextProps:

else if (isCustomComponent(this._tag, nextProps)) {
  if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
    DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
  }
}

But the corresponding section is missing for lastProps (deleting), which results in the incorrect behavior.

I'm starting the work on the patch.

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

No branches or pull requests

1 participant