Skip to content

Commit b8bb500

Browse files
committed
for some reason the class attribute *MUST* be last in array!
1 parent fff65da commit b8bb500

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: examples/todo-list/elmish.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function add_attributes (attrlist, node) {
7171
node.focus();
7272
break;
7373
case 'checked':
74-
node.setAttribute('checked', 'checked');
74+
node.setAttribute('checked', true);
7575
case 'class':
7676
node.className = a[1]; // apply one or more CSS classes
7777
break;

Diff for: examples/todo-list/todo-app.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,10 @@ function render_main (model, signal) {
111111
// console.log('display:', display);
112112
return (
113113
section(["class=main", "id=main", display], [ // hide if no todo items.
114-
input(["id=toggle-all", "class=toggle-all", "type=checkbox",
114+
input(["id=toggle-all", "type=checkbox",
115115
typeof signal === 'function' ? signal('TOGGLE_ALL') : '',
116-
(model.all_done ? "checked=checked" : "")
116+
(model.all_done ? "checked=checked" : ""),
117+
"class=toggle-all"
117118
], []),
118119
label(["for=toggle-all"], [ text("Mark all as complete") ]),
119120
ul(["class=todo-list"],

0 commit comments

Comments
 (0)