Fix first row of itemTree not getting announced (#4448)

Tweak to the conditional to check if something is focused
via selection.count (instead of selection.focused which
defaults to 0 and fails on the first focused item).

Post: 40fd5efe05.

Fixes: #4444
This commit is contained in:
abaevbog 2024-07-27 23:59:01 -07:00 committed by GitHub
parent 00ae8bb9b2
commit 1cdb364361
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1432,7 +1432,7 @@ class VirtualizedTable extends React.Component {
// Set aria-activedescendant on table container
_setAriaAciveDescendant() {
if (!this.selection.focused) return;
if (!this.selection.count) return;
let selected = this._jsWindow?.getElementByIndex(this.selection.focused);
if (selected) {
selected.closest(".virtualized-table").setAttribute("aria-activedescendant", selected.id);