-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
complain if named slots other than direct descendant of component #4509
complain if named slots other than direct descendant of component #4509
Conversation
d9ece3c
to
0e219ab
Compare
0e219ab
to
d185a20
Compare
@@ -395,7 +395,7 @@ export default class Element extends Node { | |||
component.slot_outlets.add(name); | |||
} | |||
|
|||
if (!(parent.type === 'InlineComponent' || (parent.type === 'Element' && /-/.test(parent.name)))) { | |||
if (!(parent.type === 'InlineComponent' || within_custom_element(parent))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can actually allow it if it is within custom element, since we are going to create them just like a normal element, browser will figure out itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this relates to #1689 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the error message be adjusted then? Something like 'must be a direct child of a component or a descendant of a custom element'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup! updated the error message
Fixes #3385
allow nested named slots if it is within custom element