     om/IWillUnmount
     (will-unmount [_]
       (swap! modals-status disj (om/get-state owner :id)))
+    ;; om/IDidUpdate
+    ;; (did-update [_ next-props _]
+    ;;   (println "IDidUpdate" (om/get-state owner :id) (:show next-props) "->" (:show app))
+    ;;   (when (< 1 (count @modals-status))
+    ;;     (let [id (om/get-state owner :id)
+    ;;           e (.getElementById js/document id)
+    ;;           scrollTop (.-scrollTop e)
+    ;;           itop (.-innerWidth js/top)
+    ;;           ]
+    ;;       ;;(.setAttribute e "style" (str "margin-top:"  (.-scrollTop e) "px"))
+    ;;       ))
+    ;;   )
+    om/IWillUpdate
+    (will-update [_ next-props _]
+      ;;(println "IWillUpdate" (:show next-props) "->" (:show app))
+      (when (not (:show next-props))
+        (set! (.-scrollTop (.getElementById js/document (om/get-state owner :id))) 0)))
     om/IRenderState
     (render-state [this {id :id}]
       (println "modal id:" id)
       (let [show? (:show app)]
         (swap! modals-status (if show? conj disj) id)
-        (dom/div #js {:aria-hidden "true"
+        (dom/div #js {:id id
+                      :aria-hidden "true"
                       :aria-labelledby label
                       :style (if show?
                                #js {:display "block" :paddingLeft 0}

(defn modal-show [app]
  (om/transact!
   app :show
   (fn [i] (if i (inc i) 0))))

(defn modal-hide [app]
  (om/transact!

     (let[tag-body (aget (query "body") 0)]
       (if (empty? new)
         (goog.dom.classes/remove tag-body "modal-open")
         (goog.dom.classes/add    tag-body "modal-open")))

     (let [d (clojure.set/difference new old)]
       (when (not (empty? d))
         (let [new-dialog-id (first d)]
           (println "Открылся " new-dialog-id)))))))

(defn modal [app owner {:keys [label
                               header
