Skip to content

Commit 2d56ff4

Browse files
authored
IBX-6025: Properties of one custom tag showing in the preview of another (#97)
1 parent 6868fe6 commit 2d56ff4

File tree

1 file changed

+15
-1
lines changed
  • src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag

1 file changed

+15
-1
lines changed

src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-ui.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,27 @@ class IbexaCustomTagUI extends Plugin {
148148
hideAttributes() {
149149
this.balloon.remove(this.attributesView);
150150
this.editor.editing.view.focus();
151+
this.reinitAttributesView();
151152
}
152153

153154
showForm() {
154155
const modelElement = this.editor.model.document.selection.getSelectedElement();
155156
const values = modelElement.getAttribute('values');
157+
const parsedValues = Object.entries(values).reduce((output, [key, value]) => {
158+
if (this.config.attributes[key]?.type === 'boolean') {
159+
return {
160+
...output,
161+
[key]: value === 'true',
162+
};
163+
}
164+
165+
return {
166+
...output,
167+
[key]: value,
168+
};
169+
}, {});
156170

157-
this.formView.setValues(values);
171+
this.formView.setValues(parsedValues);
158172

159173
this.balloon.add({
160174
view: this.formView,

0 commit comments

Comments
 (0)