UWP, after Windows 10 Creators Update (15063.138) Exception in ListView Item, removeEventListener
mesju opened this issue · comments
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.
Yes I am getting it too after Creators update.
Mainly when using setAt method of the binding list.
I had same problem and error with Visual Studio, but maybe I found this simple solution for me, after creators update:
- Uninstall VS 2015 and all component;
- Restart PC;
- Install VS 2017.
Now I no longer error: "Unable to get property 'handleEvent' of undefined or null reference"
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;
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.
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;