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

UWP, after Windows 10 Creators Update (15063.138) Exception in ListView Item, removeEventListener #1665

Open
mesju opened this issue Apr 13, 2017 · 5 comments

Comments

@mesju
Copy link
Contributor

mesju commented Apr 13, 2017

base.js:

6468:    _Base.Namespace._moduleDefine(exports, "WinJS.Utilities", {

...

6548:     _removeEventListener: function _removeEventListener(element, type, listener, useCapture) {
            var eventNameLower = type && type.toLowerCase();
            var entry = customEvents[eventNameLower];
            var equivalentEvent = _BaseUtils._browserEventEquivalents[type];
            if (entry) {
                entry.unregister(element, type, listener, useCapture);
            } else if (equivalentEvent) {
                element.removeEventListener(equivalentEvent, listener, useCapture);
            } else {
                element.removeEventListener(type, listener, useCapture);
            }
        },

...

6557 element.removeEventListener(type, listener, useCapture), throws

Unhandled exception at line 6557, column 17 in ms-appx://.../WinJS/js/base.js 0x800a138f - JavaScript runtime error: Unable to get property 'handleEvent' of undefined or null reference

Stacktrace:

_removeEventListener [base.js] Line 6557	Script
ItemEventsHandler_resetPointerDownState [ui.js] Line 8574	Script
ItemEventsHandler_onDataChanged [ui.js] Line 8468	Script
SelectionMode_onDataChanged [ui.js] Line 10027	Script
ListView_synchronize [ui.js] Line 22004	Script
ListView_update [ui.js] Line 22235	Script
ListView_endNotifications [ui.js] Line 21770	Script
_endNotifications [base.js] Line 11278	Script
endNotifications [base.js] Line 10662	Script
Anonymous function [ui.js] Line 744	Script
forEachBindingRecord [ui.js] Line 716	Script
finishNotifications [ui.js] Line 739	Script
completeNotification [ui.js] Line 4587	Script
changed [ui.js] Line 4715	Script
...

I think "element.removeEventListener(type, listener, useCapture)" now throws an exception when the listener is undefined.

@AntGK
Copy link

AntGK commented Apr 15, 2017

Yes I am getting it too after Creators update.
Mainly when using setAt method of the binding list.

@Loginstudio
Copy link

Loginstudio commented May 4, 2017

I had same problem and error with Visual Studio, but maybe I found this simple solution for me, after creators update:

  1. Uninstall VS 2015 and all component;
  2. Restart PC;
  3. Install VS 2017.

Now I no longer error: "Unable to get property 'handleEvent' of undefined or null reference"

@ELKINBARRETOC
Copy link

También se me ha presentado este error cuando trato de establecer la propiedad groupDataSource de un ListView.

Esta línea de código genera el error:

miListView.groupDataSource = null;

@chotikarn
Copy link

Any update on this error?
I already use VS2017 and i have same error when try to push new data to ListView and reset data to null.

@ELKINBARRETOC
Copy link

Hola,

Ya encontré una solución a este error, simplemente en vez de asignar null, asigné una new BindingList recibiendo de parámetro un array vacío:

var emptyArray= []
var newData= new WinJS.Binding.List(emptyArray);
MyListView.itemDataSource = newData.dataSource;

dantler added a commit to dantler/winjs that referenced this issue Jul 15, 2017
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

5 participants