TypeError: Cannot read properties of null (reading 'getAttribute')
at TabberEvent.getActiveTabpanel (<anonymous>:565:354)
at TabberEvent.resume (<anonymous>:567:146)
at TabberEvent.init (<anonymous>:567:646)
at <anonymous>:570:55
Another exception follows it:
TypeError: Cannot read properties of null (reading 'getAttribute')
at TabberEvent.getActiveTabpanel (<anonymous>:565:354)
at TabberEvent.resume (<anonymous>:567:146)
at <anonymous>:567:571
at Array.forEach (<anonymous>)
at IntersectionObserver.<anonymous> (<anonymous>:567:523)
On current HEAD (https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue/commit/35ffe555c07fd06439db5c7e161cd1214a65d6c0) I noticed this issue when scrolling the tabber element quickly into viewport while the page is still loading.
this.activeTab
isnull
, hence the stack trace:Another exception follows it:
The race condition happens because in
TabberBuilder.init()
, initializingaria-selected="true"
happens duringrequestAnimationFrame
viaTabberAction.setActiveTab()
. It is not guaranteed (?) to happen before the followingnew TabberEvent()
. https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue/blob/35ffe555c07fd06439db5c7e161cd1214a65d6c0/modules/ext.tabberNeue/ext.tabberNeue.js#L605-L611