Pārlūkot izejas kodu

shift-enter in A1 does nothing instead of wrapping

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Brandon Wong 3 nedēļas atpakaļ
vecāks
revīzija
7509ba530a
1 mainītis faili ar 5 papildinājumiem un 11 dzēšanām
  1. 5 11
      frontend/src/cljs/microtables_frontend/events.cljs

+ 5 - 11
frontend/src/cljs/microtables_frontend/events.cljs

@@ -70,17 +70,11 @@
 (re-frame/reg-event-fx
  ::press-shift-enter-in-cell
  (fn [{:keys [db]} [_ c r]]
-   (let [min-row? (= r 1)
-         min-col? (= c "A")
-         new-col (if min-row?
-                   (if min-col?
-                     (coords/highest-col db)
-                     (coords/prev-letter c))
-                   c)
-         new-row (if min-row?
-                   (coords/highest-row db)
-                   (dec r))]
-     {:focus-on-cell [new-col new-row]})))
+   (when-not (and (= r 1) (= c "A"))
+     (let [min-row? (= r 1)
+           new-col (if min-row? (coords/prev-letter c) c)
+           new-row (if min-row? (coords/highest-row db) (dec r))]
+       {:focus-on-cell [new-col new-row]}))))
 
 (re-frame/reg-fx
  :focus-on-cell