Skip to content

Read Aloud stops working when reaching a custom HTML element #471

Open

Description

Description

Hi MS Edge Team,

I found the tool "Read Aloud" to fail when I use one of my custom components. What happens is that Read Aloud starts reading some text on the page, and then it reaches my custom component, and stops. Then the web page becomes unresponsive, until I finally get the alert box saying that the page is not responding and asking to wait or leave the page.

Also, sometimes it even does not read any text on the page and just freezes/stops working, making the page to be unresponsive as well.

I have attached a more decent HTML file that you can run on MS Edge to reproduce this error. Please follow these steps:

  1. Download the read-aloud-vanilla-js-component.html file
  2. Open MS Edge
  3. Open the file using MS Edge
  4. Now Open Read Aloud (CTRL + SHIFT + U) - it will start reading automatically

Expected behavior

Read Aloud reads the whole page's text and then stops

Actual behavior:

Read Aloud reads the first part of the text (not always this happens - sometimes it just freezes). Reaches the component and It stops reading and the page becomes unresponsive. Sometimes It takes a lot of time (and I mean it) to finish reading the page. In summary, its behavior is very unpredictable.

Notes

I have some points I would like to mention, because I think this will help you to understand better and therefore, fix this issue faster.

First, the custom element (CE) has 2 named slots in an specific order. When the issue happens, I have my CE with 2 nested children that are using those named slots, but not necessarily on the same order as they are within the shadow DOM definition of the CE.

So for instance if my CE has 2 slots defined as:

<slot name="slot-1"></slot>
<slot name="slot-2"></slot>

and I use the CE as follows:

<!-- Notice that the first child is using slot-2 and the second is using slot-1 -->

<custom-container><span slot="slot-2">This text in slot 2.</span><span slot="slot-1">This is text in slot 1.</span></custom-container>

Read Aloud will fail. This is the same example you will find on the attached html file: read-aloud-vanilla-js-component.html

I am more than happy to collaborate in case you need more specific details of this issue.

read-aloud-vanilla-js-component.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions