           :on-mouse-enter #(do
                             (swap! doc update-in [:rating-clicked] (fn [] false))
                             (swap! doc update-in [:rating] (fn [] index)))
-          :on-mouse-leave #(swap! doc update-in [:rating] (fn [] 0))
+          :on-mouse-leave #(do
+                             (swap! doc update-in [:rating] (fn [] 0))
+                             (when-not (:rating-clicked @doc)
+                               (swap! doc update-in [:bookmark/rating] (fn [] 0))))
           :on-click #(do
                       (swap! doc update-in [:rating-clicked] (fn [] true))
                       (swap! doc update-in [:bookmark/rating] (fn [] index)))}])

                                   children))))

  ;; Update the state in the remote repository.
  (go (let [bookmark (dissoc @doc :bookmark/_parent :folder?)]
        (<! (http/put (str (:host-url env) (:prefix env) "/api/bookmarks/" (:bookmark/id @doc))
                      {:edn-params bookmark
                       :with-credentials? false

  (swap! doc #(assoc @doc :bookmark/parent {:db/id (get-active)}))

  ;; Update the state in the remote repository.
  (go (let [bookmark (dissoc @doc :bookmark/_parent :folder? :add? :query? :rating :rating-clicked)
            body (:body (<! (http/post (str (:host-url env) (:prefix env) "/api/bookmarks")
                                       {:edn-params bookmark
                                        :with-credentials? false
