Skip to content

Commit

Permalink
fix: date picker prevent default
Browse files Browse the repository at this point in the history
  • Loading branch information
Weihua Lu committed Apr 30, 2021
1 parent 0ae0634 commit d04b688
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/frontend/ui/date_picker.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -206,26 +206,30 @@
(defn shortcut-prev-day
[_state e]
(when-not (input-or-select?)
(util/stop e)
(swap! *internal-model inc-date -1)))

(defn shortcut-next-day
[_state e]
(when-not (input-or-select?)
(util/stop e)
(swap! *internal-model inc-date 1)))

(defn shortcut-prev-week
[_state e]
(when-not (input-or-select?)
(util/stop e)
(swap! *internal-model inc-week -1)))

(defn shortcut-next-week
[_state e]
(when-not (input-or-select?)
(util/stop e)
(swap! *internal-model inc-week 1)))

(rum/defc date-picker < rum/reactive
(mixins/shortcuts
#(shortcut/install-shortcut! % {:prevent-default? true})
#(shortcut/install-shortcut! % {})
:shortcut-listener/date-picker
{:date-picker/complete shortcut-complete
:date-picker/prev-day shortcut-prev-day
Expand Down

0 comments on commit d04b688

Please sign in to comment.