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

Fragment block should retain authored classes #409

Open
ujjwal5 opened this issue Oct 4, 2024 · 0 comments · May be fixed by #434
Open

Fragment block should retain authored classes #409

ujjwal5 opened this issue Oct 4, 2024 · 0 comments · May be fixed by #434

Comments

@ujjwal5
Copy link

ujjwal5 commented Oct 4, 2024

Expected Behaviour

  • The classes defined for a fragment block (in documents) should be retained when the fragment block is rendered.

Actual Behaviour

  • The classes defined for the fragment block are not retained.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

  • Include a fragment in a document and define specific classes for the fragment block.
  • Add CSS for the defined class.
  • Preview or publish the page. When the page is rendered, the CSS class is not applied because the class is missing from the HTML DOM.

HTML changes

The HTML structure of the fragment block differs from other blocks. Typically, the structure follows: container → wrapper → block. However, for the fragment block, it only includes container → wrapper, omitting the block level.

With this update, classes defined in the referred fragment section, which was previously copied into the fragment block section, will remain in the referred fragment section. Further, all the referred fragment sections will now be copied under the fragment block, ensuring the same HTML DOM standards as other blocks.

Platform and Version

Verified with latest bolierplate code.

Sample Code that illustrates the problem

The problem is caused by this code section: https://github.com/adobe/aem-boilerplate/blob/main/blocks/fragment/fragment.js#L49-L52

@ujjwal5 ujjwal5 changed the title Fragment block should retain authored classes and render all authored sections Fragment block should retain authored classes Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant