0

I am using re-frame to dev a clojurescript app. It saves the option of select. @new-feedback is the atom which will change whenever I pick up a new option. And then after click the save button, it will save the data.

:on-click #(re-frame/dispatch [:feedback {:feedback-desc @new-feedback :alert-id alert-id} ])

Please check in https://github.com/wqhhust/test_frame/blob/master/src/cljs/test_frame/views.cljs#L36

And then the dispatch will trigger the handle of logic:

   (assoc-in db [:alerts (keyword (str (:alert-id feedback))) :feedback-desc] (:feedback-desc feedback))))

It will save the new feedback into the global database. https://github.com/wqhhust/test_frame/blob/master/src/cljs/test_frame/handlers.cljs#L16

When I open it PC browser, click an element and pick up the option save it, if re-click the element again, then I could see the saved value. But when I do it on mobile browner, no matter on android phone, iphone or tablet, it doesn't save the data, every time I re-open the element, the saved data is gone.

Daniel Wu
  • 5,853
  • 12
  • 42
  • 93

1 Answers1

0

Oh, my first guess is that this is not an issue with the code but with the event. Do you really click the element on your non-PC device or are you tapping it? Tap and click events are not interchangeable.

Please comment if this was the problem. I am curious to know

Sailor
  • 91
  • 5