|
@@ -229,15 +229,14 @@
|
|
|
|
|
|
(defn auto-complete-open-link
|
|
|
[state e]
|
|
|
- (let [[matched {:keys [on-chosen-open-link]}] (:rum/args state)
|
|
|
- current-idx (get state :frontend.ui/current-idx)]
|
|
|
- (util/stop e)
|
|
|
- ;; FIXME: on-chosen-open-link might be nil
|
|
|
- (when (and on-chosen-open-link
|
|
|
- (seq matched)
|
|
|
- (> (count matched)
|
|
|
- @current-idx))
|
|
|
- (on-chosen-open-link (nth matched @current-idx) false))))
|
|
|
+ (let [[matched {:keys [on-chosen-open-link]}] (:rum/args state)]
|
|
|
+ (when (and on-chosen-open-link (not (state/editing?)))
|
|
|
+ (let [current-idx (get state :frontend.ui/current-idx)]
|
|
|
+ (util/stop e)
|
|
|
+ (when (and (seq matched)
|
|
|
+ (> (count matched)
|
|
|
+ @current-idx))
|
|
|
+ (on-chosen-open-link (nth matched @current-idx) false))))))
|
|
|
|
|
|
;; date-picker
|
|
|
;; TODO: find a better way
|