|
|
@@ -45,11 +45,17 @@
|
|
|
|
|
|
; handle pressing enter (move to the next cell down)
|
|
|
; tab is taken care of natively, and is good enough
|
|
|
+;TODO: keyboard movement should determine the size of the table, not the other way around
|
|
|
+; - highest-row/col should include the position of the in-focus cell
|
|
|
+; - this function should merely increment the position
|
|
|
+; - add a new function for tab handling (native isn't good enough anymore)
|
|
|
+;TODO: handle movement within a range selection
|
|
|
+;TODO: handle movement with arrow keys
|
|
|
(re-frame/reg-event-fx
|
|
|
::press-enter-in-cell
|
|
|
(fn [{:keys [db]} [_ c r]]
|
|
|
- (let [max-row? (= (coords/highest-row (:table-data db)) r)
|
|
|
- max-col? (= (coords/highest-col (:table-data db)) c)
|
|
|
+ (let [max-row? (= (coords/highest-row db) r)
|
|
|
+ max-col? (= (coords/highest-col db) c)
|
|
|
new-col (if max-row?
|
|
|
(if max-col?
|
|
|
"A"
|