Fork me on GitHub
#reagent
<
2022-09-24
>
Benjamin17:09:01

[:div#drop
   :style {:margin "1rem"
            :padding-top "2.5rem"}
    :on-dragenter (fn [event] ...  ) 
I am trying to make a file drop area, do all those "on..." event methods work the same as on-click something doesn't work yet with my component.

p-himik17:09:22

All the attributes must go into an attribute map.

p-himik17:09:37

Like in [:div {:style ...} ...] and not [:div :style ... ...].

Benjamin17:09:19

[:div#drop
   {:style {:margin "1rem"
            :padding-top "2.5rem"}
    :on-dragover
    (fn [event]
      (js/console.log "dragover"))}
   "drop a file here"]

p-himik18:09:19

Ah, and try :on-drag-over instead.

Benjamin06:09:01

ah nice now it works thanks

👍 1
Benjamin06:09:22

on-drag-over is correct