-
-
Notifications
You must be signed in to change notification settings - Fork 47
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 duplicate Page root element id #554
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR @marcosvafilho |
Thanks, @jonasjabari , no rush. I appreciate your feedback. Happy to improve whatever you identify as necessary. |
Hey @marcosvafilho First of all: I realized there was an issue with your last PR #551 which the specs didn't cover and I oversee. This part https://github.com/matestack/matestack-ui-core/blob/next_release/lib/matestack/ui/core/page.rb#L18 is responsible for rendering only the page without the wrapping structure when performing a dynamic page transition (indicated by the query param only_page=true). Within this part the Second: You moved the I think all described issues (including your original duplicated ID issue) can be simply fixed by removing the wrapping
Hope that makes sense. Probably not too easy to get your head around if your not too deep involved in the core implementation. |
Hey @jonasjabari , thanks for this valuable feedback. Yeah, a bunch of stuff to get my head around, but sure a fun task to do :) I'll take some time to digest all the new information and then I get back to you. Thanks again! |
Issue:
Matestack by default renders two Page root elements, both containing a child
div
with thev-if
directive, for instructing Vue.js on wether or not rendering the child element:This used to be a non-issue, but now we've added an
id
attribute to the Page's root element, containing both the controller and the action, as we can see in the example above.Although it doesn't appear to cause any actual problem right now, we cannot guarantee it won't cause in the future.
Also, it's not compliant with the HTML spec, which dictates the
id
attribute must be unique.Changes
div
s containing thev-if
directive.Notes
matestack-ui
, which is added to both Pages and Apps. Since Apps can wrap Pages, we can have the situation of two elements with the very sameid
attribute. This PR does not fix this other issue, but I'll start a conversation with the maintainers about that.