fix(template): Use <div>
instead of <main>
to support Vue3 apps mounting
#50127
+9
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
main
elements nextcloud-libraries/nextcloud-vue#6018Summary
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