enterprise: Tabs: TypeError: Cannot read properties of undefined (reading 'parent')
Describe the bug
One scenario is that:
We initialize the tabs component and then destroy/updated tabs component immediately.
And then some errors occured:
TypeError: Cannot read properties of undefined (reading 'parent') at Tabs.positionFocusState (tabs.js:3816:33) at tabs.js:491:12
To Reproduce
Steps to reproduce the behavior:
1.There is one mock javascript file to reproduce this issue, it just simplifies the logic in tabs.js file.
TabsMock.zip
2.You can download the attachment file [TabsMock.zip] and unzip it and just run the TabsMock.js file.
3.Then you will see the error:
The logic to reproduce this issue is that: Initialize the tabs component and then call the destroy method or updated method immediately.
Expected behavior
Version
- ids-enterprise: v4.91.0, it can be reproduced in the earlier version.
Screenshots
Platform
- Infor Application/Team Name: Infor SunSystems
- Device:
- OS Version: Windows 11
- Browser Name: chrome
- Browser Version: 121.0.6167.140 (Official Build) (64-bit)
Additional context
The reason for this issue might be that there is a timer, see it below.
And the timer will be called after 100ms.
And if destroy method OR updated method is called before the timer, the variable focusState will be set ‘undefined’, and then
the error will occur.
I just wonder that whether it is better to ‘clearTimeout’ when destroy method OR updated method is called.
For example:
About this issue
- Original URL
- State: closed
- Created 5 months ago
- Comments: 19 (9 by maintainers)
@tmcconechy When I upgrade IDS to 4.92.2, a new error occurred before the above error I mentioned before, so I am currently unable to verify the original error.
The new error is: TypeError: Cannot read properties of undefined (reading ‘prop’)
As a lowly, data entering end user of EQ, this repetitive error I get screenshotted below annoys me to no end after our recent transition from sales portal. I’m told it’s an Infor thing that our IT team can’t fix but that you all are on it.
I am not confident at all that this is even related to this thread but please oh please make it stop. Your little website chat people didn’t want to give me an email address.
Hi @tmcconechy
Time ran out on me unfortunately. I have asked if @adamzhang1932 in Shanghai might pick this up and run with it. Otherwise I may be able to carry on on Monday.
Have a great weekend
Thanks @tmcconechy . That’s excellent. I’ll give that a try tomorrow.
Theo’s (.net) team may use Angular I think. But java team (inc myself, Adam and Rikesh) use ids-enterprise.
@nbeare-infor yes its available as enterprise release:
https://www.npmjs.com/package/ids-enterprise/v/4.92.3 https://github.com/infor-design/enterprise/releases/tag/4.92.3
(i thought you used angular)
@nbeare-infor @adamzhang1932
We can include it in 4.93.0 if clearer. Or if you want to suggest an exact code change to fix it and I can add that? Thanks!