[bug] removeDefaultStyles does not remove default styles on ResponsiveGrid

Open Beginner friendly
#292 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
react, typescript
Domain
frontend

Research direction

Start in src/components/ResponsiveGrid.tsx around line 45 and trace how removeDefaultStyles, isInEditor, and gridClassNames determine the className. Reproduce the issue with ResponsiveGrid, then verify that the expected grid styles are removed when removeDefaultStyles is enabled while editor behavior remains correct.

Written by the indexing model from the issue text.

Description

bug

Describe the bug
Adding removeDefaultStyles to ResponsiveGrid does not remove styles.

Ref: https://github.com/adobe/aem-react-editable-components/blob/master/src/components/ResponsiveGrid.tsx#L45

  if (isInEditor || !props.removeDefaultStyles) {
    className = `${className} ${props.gridClassNames || ''} ${ClassNames.CONTAINER}`;
  }

The code here shows that isInEditor will always return true and it seems impossible to override gridClassNames prop.

We want to use a custom grid but this is forcing our hand.

Package version
2.1.1

To Reproduce

  1. Add removeDefaultStyles to ResponsiveGrid

Expected behavior
Grid styles removed in AEM

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Dominant language
TypeScript
Stars
68
Forks
35
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from adobe/aem-react-editable-components

All issues in adobe/aem-react-editable-components

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.