html 元素是否需要屏幕阅读器阅读焦点

Does an html element require focus to be read by screen readers

如果我在屏幕上的某处显示模态,并且我希望屏幕 reader 在某个时候读取它,将 aria-live 设置为其中一个值是否足够,或者我是否也有在显示元素时明确聚焦该元素?

根据 W3C:

Depending upon the action to be performed by the dialog, the object with focus before the dialog box is opened should be saved. This will allow restoring focus to this element when the dialog box is closed. When the dialog box is opened, focus should be set to the first tab focusable element within the dialog. If there is no tab focusable element within the dialog box contents, set the focus to the item that is used to cancel or close the dialog. There must be some element within the dialog which can accept focus in order for the screen reader to speak the dialog title and information when it is opened. In order to prevent keyboard focus from leaving the dialog, determine the first and last tab focusable elements in the dialog and trap keyboard events within the document.

这并没有具体说明如果您不这样做会出现什么问题,但是这个 SO 问题 Setting focus of a screen reader on a modal alert in ember 暗示如果您不这样做,屏幕 reader 将无法工作这样做。