Skip to content

Commit

Permalink
fix: restore fallback on getElementName
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaSimonePorceddu authored and Mauro Erta committed Nov 30, 2022
1 parent 30b00c5 commit 1f1ce8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/svelte/src/morfeoAction.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { getStyles } from '@morfeo/jss';
import { component, Style } from '@morfeo/web';

const DEFAULT_ELEMENT_NAME = 'morfeo-element'

function getElementName({ componentName, variant, state }: Style) {
let elementName = '';

Expand All @@ -16,7 +18,7 @@ function getElementName({ componentName, variant, state }: Style) {
elementName = `${elementName}-${state}`;
}

return elementName;
return elementName || DEFAULT_ELEMENT_NAME;
}

function setAdditionalProps(
Expand Down

0 comments on commit 1f1ce8d

Please sign in to comment.