enterprise icon indicating copy to clipboard operation
enterprise copied to clipboard

Trackdirty: Element removed from dom will cause error

Open Sovia opened this issue 2 years ago • 2 comments

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 avatar Jul 27 '22 17:07 Sovia

@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.

yohannahbautista avatar Aug 08 '22 06:08 yohannahbautista

@Sovia, can you provide an example of this issue?

ericangeles avatar Aug 08 '22 07:08 ericangeles

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?

Sovia avatar Sep 02 '22 14:09 Sovia

Maybe this change would just solve it if (!d.icon.is('.icon-dirty')) { -> if (!d?.icon?.is('.icon-dirty')) { @ericangeles ?

tmcconechy avatar Sep 02 '22 15:09 tmcconechy

QA validated and passed.

image

image

glenlieorillo avatar Sep 12 '22 10:09 glenlieorillo