Skip to content

Dismissable alert breaks #77

@ebellani

Description

@ebellani

Executing the code at the branch https://github.com/ebellani/om-bootstrap/tree/dismissable-alert-timeout
will produce the exception

random.js:474 Uncaught TypeError: G__14921.set_timeout is not a function

which is the result IMO of this code

(defcomponentk alert*
  "Renders the alert component with timeout mixed in. TODO: This
   should probably use the component macro and be defined inline under
   the alert function. No need for a separate name."
  [[:data bs props children] owner]
  (:mixins m/set-timeout-mixin)
  (did-mount [_] (when (and (:on-dismiss bs) (:dismiss-after bs))
                   (doto owner 
                      ;;  BREAK
                     (.set-timeout (:on-dismiss bs)
                                   (:dismiss-after bs)))))
  (render
   [_]
   (let [classes (t/bs-class-set bs)
         dismiss-button (when-let [od (:on-dismiss bs)]
                          (d/button {:type "button"
                                     :class "close"
                                     :on-click od
                                     :aria-hidden true}
                                    "×"))]
     (d/div (u/merge-props props {:class (d/class-set classes)})
            dismiss-button
            children))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions