Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(template): Use <div> instead of <main> to support Vue3 apps mounting #50127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jan 10, 2025

Summary

Vue3 does not replace the element while mounting but only renders within (replace inner HTML).
So it would result in two stacked <main> elements which is invalid and an accessibility issue.
Instead we just use a <div> element for mounting.

For Vue2 apps this does not change anything as the whole element will be replaced with a new <main> element.
For vanilla apps this will slightly decrease the accessibility as the main landmark is now missing, but this is not a hard accessibility issue as it would be for Vue3 apps having two main elements.

Checklist

…ounting

Vue3 does not replace the element while mounting but only renders within
(replace inner HTML).
So it would result in two stacked `<main>` elements which is invalid and
an accessibility issue.
Instead we just use a `<div>` element for mounting.

For Vue2 apps this does not change anything as the whole element will be
replaced with a new `<main>` element.
For vanilla apps this will slightly decrease the accessibility as the
main landmark is now missing, but this is not a hard accessibility issue
as it would be for Vue3 apps having two main elements.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux force-pushed the fix/template-vue3-main branch from 77da7c7 to df56b47 Compare January 10, 2025 17:45
@susnux susnux requested a review from ShGKme January 11, 2025 09:27
@susnux susnux marked this pull request as ready for review January 11, 2025 09:27
Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add main to the dashboard, settings apps?

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

Successfully merging this pull request may close these issues.

[vue3] NcAppContent causes two main elements
2 participants