Skip to content

Commit c5fe35b

Browse files
committed
Fix data-on-load to replicate once behaviour
1 parent b3ad327 commit c5fe35b

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

examples/billion_cells/src/app/main.clj

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -225,19 +225,21 @@
225225
(and focus (= focus sid))
226226
(let [on-load (str "$cellvalue = '" (or value "") "';el.focus();")
227227
on-input (str "@post('" handler-save-cell "')")
228-
id (str "focus-" local-id)]
228+
id (str "focus-" local-id)]
229229
(h/html
230230
[:div.focus-cell
231231
[:input.focus-user
232-
{:id id
233-
:data-id local-id
234-
:data-parentid chunk-id
235-
:maxlength 20
236-
:size 10
237-
:type "text"
238-
:data-on-load on-load
239-
:data-bind "cellvalue"
240-
:data-on-input__debounce.200ms on-input}]]))
232+
(array-map
233+
:id id
234+
:data-id local-id
235+
:data-parentid chunk-id
236+
:maxlength 20
237+
:size 10
238+
:type "text"
239+
:data-on-load on-load
240+
:data-preserve-attr "data-on-load"
241+
:data-bind "cellvalue"
242+
:data-on-input__debounce.200ms on-input)]]))
241243

242244
focus
243245
(h/html
@@ -451,4 +453,3 @@
451453
;; focus element
452454
;; focus element value
453455
;; swap
454-

examples/billion_checkboxes_blob/src/app/main.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353
" - "
354354
[:a {:href "https://github.com/andersmurphy/hyperlith/blob/master/examples/billion_checkboxes_blob/src/app/main.clj" } "source"]
355355
" - "
356-
[:a {:href "https://lospec.com/palette-list/pico-8"} "palette"]]])))
356+
[:a {:href "https://cells.andersmurphy.com"} " more like this"]]])))
357357

358358
(def blank-chunk
359359
(-> (repeat (* chunk-size chunk-size) 0)

0 commit comments

Comments
 (0)