Skip to content

Commit

Permalink
fix(mergeClassNames): prevent classes with the same name being merged (
Browse files Browse the repository at this point in the history
…#413)

* fix class duplication onResize touch event

Co-authored-by: François Chalifour <[email protected]>
  • Loading branch information
shortcuts and francoischalifour authored Jan 26, 2021
1 parent 76ae584 commit 9651481
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/autocomplete-js/src/utils/mergeClassNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export function mergeClassNames(
const accValue = acc[key];
const currentValue = current[key];

acc[key] = [accValue, currentValue].filter(Boolean).join(' ');
if (accValue !== currentValue) {
acc[key] = [accValue, currentValue].filter(Boolean).join(' ');
}
});

return acc;
Expand Down

0 comments on commit 9651481

Please sign in to comment.