Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

jqLite#removeData shouldn't touch the event handlers' storage #15869

Closed
@mgol

Description

@mgol

I'm submitting a ...

  • bug report
  • feature request
  • other (Please do not submit support requests here (see above))

Current behavior:
jqLite#removeData currently:

  1. Clears the element data.
  2. Detaches event handlers.

Expected / new behavior:
The second behavior is incorrect; the only data touched should be user-provided data, i.e. those set via elem.data(key, value). That's how jQuery behaves.

If complete deallocation of event handlers is required as well, one can use:

jqLite.cleanData(elements);

Note that currently jqLite.cleanData defers to jqLiteRemoveData under the hood so its implementation will have to be changed when jqLiteRemoveData is fixed.

Minimal reproduction of the problem with instructions:
AngularJS + jqLite (handler removed): http://plnkr.co/edit/XBw30umyz68UnERE9LyS?p=preview
AngularJS + jQuery (handler not removed): http://plnkr.co/edit/sdo9ShVA66yuEIIEvlII?p=preview

Angular version: 1.x.y

1.6.3, snapshot as well

Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

All

Anything else:

This will require a breaking change in jqLite. Setting to 1.7.0.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions