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: duplicate behavior for slotted content when no template is present #5174

Merged
merged 9 commits into from
Jan 30, 2025

Conversation

jhefferman-sfdc
Copy link
Collaborator

Details

  • 😮‍💨 No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • 🤞 No, it does not introduce an observable change.

GUS work item

W-17657735

@jhefferman-sfdc jhefferman-sfdc requested a review from a team as a code owner January 29, 2025 17:10
Comment on lines 104 to 106
_shadowSlottedContent: any,
_lightSlottedContent: any,
_scopedSlottedContent: any,
Copy link
Collaborator

Choose a reason for hiding this comment

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

BOOOO

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had a feeling this might upset you :p

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(sorry)

@@ -101,27 +101,33 @@ export function renderAttrsNoYield(
}

export function* fallbackTmpl(
_shadowSlottedContent: unknown,
shadowSlottedContent: AsyncGeneratorFunction,
_lightSlottedContent: unknown,
_scopedSlottedContent: unknown,
Cmp: LightningElementConstructor,
_instance: unknown
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
_instance: unknown
instance: unknown

yield '<template shadowrootmode="open"></template>';
yield `<template shadowrootmode="open"></template>`;
if (shadowSlottedContent) {
yield shadowSlottedContent(_instance);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
yield shadowSlottedContent(_instance);
yield shadowSlottedContent(instance);

}
}

export function fallbackTmplNoYield(
emit: (segment: string) => void,
_shadowSlottedContent: unknown,
shadowSlottedContent: AsyncGeneratorFunction,
_lightSlottedContent: unknown,
_scopedSlottedContent: unknown,
Cmp: LightningElementConstructor,
_instance: unknown
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
_instance: unknown
instance: unknown

emit('<template shadowrootmode="open"></template>');
emit(`<template shadowrootmode="open"></template>`);
if (shadowSlottedContent) {
shadowSlottedContent(emit, _instance);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
shadowSlottedContent(emit, _instance);
shadowSlottedContent(emit, instance);

@jhefferman-sfdc jhefferman-sfdc merged commit 4334dc2 into master Jan 30, 2025
11 checks passed
@jhefferman-sfdc jhefferman-sfdc deleted the jhefferman/default-slot-template branch January 30, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants