Skip to content

Commit

Permalink
fix(SDK-80): Editable directive - return HTML attributes only when value
Browse files Browse the repository at this point in the history
  • Loading branch information
fgiuliani committed Aug 24, 2023
1 parent 8cc74f8 commit 0a0bb12
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/modules/editable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ export default (blok: SbBlokData) => {
blok._editable.replace(/^<!--#storyblok#/, "").replace(/-->$/, "")
);

return {
"data-blok-c": JSON.stringify(options),
"data-blok-uid": options.id + "-" + options.uid,
};
if (options) {
return {
"data-blok-c": JSON.stringify(options),
"data-blok-uid": options.id + "-" + options.uid,
};
}

return {};
};

0 comments on commit 0a0bb12

Please sign in to comment.