Revert aria-live changes

This commit is contained in:
Sergio Padrino 2023-08-02 08:16:02 +02:00
parent 5b5557bbe6
commit 9bb7b2ff8f
2 changed files with 2 additions and 36 deletions

View file

@ -20,7 +20,6 @@ import { DragData, DragType } from '../../../models/drag-drop'
import memoizeOne from 'memoize-one'
import { RowIndexPath } from './list-row-index-path'
import { sendNonFatalException } from '../../../lib/helpers/non-fatal-exception'
import { AriaLiveContainer } from '../../accessibility/aria-live-container'
/**
* Describe the first argument given to the cellRenderer,
@ -1028,32 +1027,16 @@ export class List extends React.Component<IListProps, IListState> {
* @param height - The height of the Grid as given by AutoSizer
*/
private renderContents(width: number, height: number) {
const { selectedRows, selectionMode } = this.props
const ariaLiveMessage =
selectionMode !== 'single' && selectedRows.length > 0 ? (
<AriaLiveContainer
message={`${selectedRows.length} item${
selectedRows.length > 1 ? 's' : ''
} selected`}
/>
) : null
if (__WIN32__) {
return (
<>
{ariaLiveMessage}
{this.renderGrid(width, height)}
{this.renderFakeScroll(height)}
</>
)
}
return (
<>
{ariaLiveMessage}
{this.renderGrid(width, height)}
</>
)
return this.renderGrid(width, height)
}
private onGridRef = (ref: Grid | null) => {

View file

@ -28,7 +28,6 @@ import {
} from './list-row-index-path'
import { range } from '../../../lib/range'
import { sendNonFatalException } from '../../../lib/helpers/non-fatal-exception'
import { AriaLiveContainer } from '../../accessibility/aria-live-container'
/**
* Describe the first argument given to the cellRenderer,
@ -1192,32 +1191,16 @@ export class SectionList extends React.Component<
* @param height - The height of the Grid as given by AutoSizer
*/
private renderContents(width: number, height: number) {
const { selectedRows, selectionMode } = this.props
const ariaLiveMessage =
selectionMode !== 'single' && selectedRows.length > 0 ? (
<AriaLiveContainer
message={`${selectedRows.length} item${
selectedRows.length > 1 ? 's' : ''
} selected`}
/>
) : null
if (__WIN32__) {
return (
<>
{ariaLiveMessage}
{this.renderGrid(width, height)}
{this.renderFakeScroll(height)}
</>
)
}
return (
<>
{ariaLiveMessage}
{this.renderGrid(width, height)}
</>
)
return this.renderGrid(width, height)
}
private getRowHeight = (section: number) => {