Skip to content

Conversation

@crackalak
Copy link
Contributor

This PR fixes issues with ARIA when using the standalone editor in shadow DOM: microsoft/monaco-editor#619

@ghost
Copy link

ghost commented Aug 29, 2021

CLA assistant check
All CLA requirements met.

@crackalak
Copy link
Contributor Author

To test, run monaco editor shadow dom test: microsoft/monaco-editor#2644

@alexdima alexdima added this to the September 2021 milestone Aug 30, 2021
@alexdima alexdima merged commit 1db5ca0 into microsoft:main Aug 30, 2021
@alexdima alexdima self-assigned this Aug 30, 2021
@simonh1000
Copy link

I'm trying to take advanatge of this change. My package.json has "monaco-editor": "^0.28.1" which seems to be the latest, but does not have this - oh so welcome - commit. Any advice?

@crackalak
Copy link
Contributor Author

@simonh1000 this change hasn't been released yet, it's part of the September 2021 milestone, so you'll have to join me in waiting!

@simonh1000
Copy link

simonh1000 commented Oct 11, 2021

Seems to work except for
image

@alexdima
Copy link
Member

@simonh1000 What is the problem? I'm not sure I understand from the screenshot. The property ariaContainerElement appears to be defined in the IStandaloneEditorConstructionOptions interface in the .d.ts that we ship.

@simonh1000
Copy link

document.querySelector returns an Element but the typings require an HTMLElement. As a result I get a typescript error, although the code itself seems to work as expected

@alexdima
Copy link
Member

The typing we ship is correct. We expect an HTMLElement to be passed in.

@simonh1000
Copy link

For anyone coming later, one way around the typescript error is

        let mbDomNode = document.querySelector("#code-area");
        let codeArea = mbDomNode ? (mbDomNode as HTMLElement) : undefined;

@crackalak
Copy link
Contributor Author

@simonh1000 querySelector accepts a type argument:
const codeArea = document.querySelector<HTMLElement>("#code-area");

@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants