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

Entity: Add class list rather than replace directly #2752

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Echo-az
Copy link
Contributor

@Echo-az Echo-az commented Jul 22, 2024

Use classList.add rather than setting className for entity wrapper to avoid original class loss.

@@ -107,12 +107,11 @@ function parseEntityClassName(
* @param format The source entity format object
* @returns A combined CSS class name string for entity wrapper
*/
export function generateEntityClassNames(format: ContentModelEntityFormat): string {
export function generateEntityClassList(format: ContentModelEntityFormat): string[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Changing the function name may be a breaking change as it is already exported in the index file, suggest create a new function.

@BryanValverdeU
Copy link
Contributor

@Echo-az please fix test files. Also could you please verify if this is not going to cause duplicate Entity Classes in elements and add unit test to validate.

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