Skip to content

Commit dd4bb61

Browse files
committed
Keep expanded MJML editor from un-expanding
phx-update="ignore" needs to be one level above Alpine root element
1 parent 005fa4e commit dd4bb61

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

lib/keila_web/templates/campaign/_mjml_editor.html.heex

+17-17
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,28 @@
2727
</div>
2828
</div>
2929

30-
<div
31-
id="mjml-editor-wrapper"
32-
phx-update="ignore"
33-
class="flex"
34-
x-data="{editorExpanded: false}"
35-
x-on:x-toggle-expand-editor.document="editorExpanded = !editorExpanded"
36-
>
37-
<%!--
30+
<div id="mjml-editor-wrapper" phx-update="ignore">
31+
<div
32+
class="flex"
33+
x-data="{editorExpanded: false}"
34+
x-on:x-toggle-expand-editor.document="editorExpanded = !editorExpanded"
35+
>
36+
<%!--
3837
NOTE: using width: 0 for the editor is a weird hack here because otherwise the editor kept
3938
causing the entire page to overflow.
4039
The width of the editor is controlled via the (inverse) width of the iframe instead.
4140
--%>
42-
<div class="flex-grow transition-all" style="width: 0">
43-
<div id="mjml-editor" class="editor"></div>
41+
<div class="flex-grow transition-all" style="width: 0">
42+
<div id="mjml-editor" class="editor"></div>
43+
</div>
44+
<iframe
45+
id="html-inline-preview"
46+
src="about:blank"
47+
class="transition-all"
48+
x-bind:class="editorExpanded ? 'w-0' : 'w-3/5'"
49+
>
50+
</iframe>
4451
</div>
45-
<iframe
46-
id="html-inline-preview"
47-
src="about:blank"
48-
class="transition-all"
49-
x-bind:class="editorExpanded ? 'w-0' : 'w-3/5'"
50-
>
51-
</iframe>
5252
</div>
5353

5454
<% f = form_for(@changeset, "#") %>

0 commit comments

Comments
 (0)