Describe the bug
IE tabbing is very slow in a modal dialog. We've tracked this down to modal.js getTabbableElements which is called each time a tab event is handled. The find seems to take an inordinate amount of time for modals with a lot of fields.
getTabbableElements() {
const allTabbableElements = $(this.element).find('a[href], area[href], input:not([disabled]),' +
'select:not([disabled]), textarea:not([disabled]),' +
'button:not([disabled]), iframe, object, embed, *[tabindex],' +
'*[contenteditable]').filter(':visible');
return {
first: allTabbableElements[0],
last: allTabbableElements[allTabbableElements.length - 1]
};
},
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should tab as quickly as other browsers
4.20
Some ideas for Modal.prototype.getTabbableElements():
document.querySelectorAll() instead of jQuery.find()Thinking to run the caching off dom element count (if fast enough)
Just wanted to make a note on this issue (i know its app developers doing what they do). But this form has 271 inputs on it. Which is a bit overwhelming for cognitive load. It's only going to be so fast on IE11 as there DOM rendering is very slow so i can see further issues coming up with the pattern.
I suggest max 10 things on a modal. This should perhaps be a drill in page in the SPA and perhaps with multiple pages from that page to cover all the data inputing not just a 270 item form. The PR speeds things up but i can guarantee there will be other issues with a huge modal like this especially in IE 11.
QA Passed. Tested in Below links. Working as expected. Thanks!
https://4200-rc1-enterprise.demo.design.infor.com/components/modal/test-performance.html
https://4200-rc1-enterprise.demo.design.infor.com/components/modal/example-index.html
https://4200-rc1-enterprise.demo.design.infor.com/components/modal/test-dynamic-content.html
https://4200-rc1-enterprise.demo.design.infor.com/components/editor/test-modal.html
Most helpful comment
Some ideas for
Modal.prototype.getTabbableElements():document.querySelectorAll()instead ofjQuery.find()