enterprise
enterprise copied to clipboard
Trackdirty: Element removed from dom will cause error
Describe the bug In the situation where an element is removed from the dom before the event listener functions can finish will throw an error. In combination with angular 13, this is causing pages to get reloaded.
Expected behavior It would be nice if there could be a safety check at https://github.com/infor-design/enterprise/blob/main/src/components/trackdirty/trackdirty.js#L209 to make sure that el[0] exists.
Version
- ids-enterprise: 4.64.3
Platform
- Infor Application/Team Name: Infor Landmark, all devices and browers
@Sovia @tmcconechy @ericangeles Hello, could I have an example that shows how to duplicate the error? I tried removing elements here: http://localhost:4200/ids-enterprise-ng-demo/trackdirty and using the Change Values and Save buttons to update the tracker but no error shows in the console.
@Sovia, can you provide an example of this issue?
It's an error that is occurring deep in the bowels of lmclient code, and I can't easily recreate it in ids code. Since it's a safety check, do you need an example?
Maybe this change would just solve it if (!d.icon.is('.icon-dirty')) {
-> if (!d?.icon?.is('.icon-dirty')) {
@ericangeles ?
QA validated and passed.
