Skip to content

Commit

Permalink
IBX-5950: Fixed last value from one custom class appears in another (#93
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dew326 authored Jun 22, 2023
1 parent 5f2a436 commit 43cf506
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ class IbexaCustomAttributesCommand extends Command {

cleanClasses(modelElement, classes) {
Object.keys(classes).forEach((elementName) => {
if (elementName === modelElement.name || classes[modelElement.name]) {
const selectedCustomClasses = modelElement.getAttribute('custom-classes') ?? '';
const elementCustomClassesConfig = classes[modelElement.name];
const hasOwnCustomClasses =
elementCustomClassesConfig &&
selectedCustomClasses
.split()
.every((selectedCustomClass) => elementCustomClassesConfig.choices.includes(selectedCustomClass));

if (elementName === modelElement.name || hasOwnCustomClasses) {
return;
}

Expand Down

0 comments on commit 43cf506

Please sign in to comment.