This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-25
Channels
- # aws (2)
- # aws-lambda (2)
- # beginners (95)
- # boot (47)
- # cider (13)
- # clara (5)
- # cljs-dev (36)
- # cljsjs (9)
- # clojure (51)
- # clojure-austin (1)
- # clojure-greece (25)
- # clojure-italy (4)
- # clojure-japan (10)
- # clojure-russia (13)
- # clojure-spec (61)
- # clojure-uk (25)
- # clojurescript (26)
- # core-matrix (5)
- # cursive (8)
- # data-science (7)
- # datomic (43)
- # dirac (2)
- # emacs (8)
- # events (3)
- # fulcro (17)
- # graphql (29)
- # jobs-rus (4)
- # lambdaisland (4)
- # lein-figwheel (3)
- # leiningen (60)
- # luminus (15)
- # lumo (8)
- # mount (3)
- # off-topic (28)
- # om (22)
- # onyx (115)
- # other-languages (6)
- # pedestal (5)
- # re-frame (41)
- # reagent (12)
- # ring-swagger (12)
- # shadow-cljs (127)
- # unrepl (27)
- # yada (5)
Hi, I found the following error only in iPhone safari browser, but cannot find where this error is from. Some one can help? I served the file on https://m.beta.joudou.com/wx/doumi/#/doumi and the error message is:
have you got the full error message, it looks like it's cut off at "No"....
usually it would be "No handler found for event ...." or something like that
odd that it's only in in iphone safari though
Sorry for the wrong information. The error message are not related to the steps. But the steps not work because the component-did-mount
not called. This is only on iPhone Safari. It is weird.
the re-frame:no
is actually because of no on-failure
was provided when using http-xhrio
.
component-did-mount is not getting called at all?
yep. But in Chrome it works.
(defn doumi-use-coupon-custom-coupon-input []
(let [doumi-doumi (rf/subscribe [:doumi-doumi])
value (rf/subscribe [:doumi-use-coupon-custom-value])]
(r/create-class
{:display-name "doumi-use-coupon-custom-coupon-input"
:component-did-mount (fn [e] ;; <-- THIS NOT CALLED
(.log js/console e)
(.log js/console (r/dom-node e))
(.focus (r/dom-node e))
#_(.focus (.getElementById js/document "doumi-custom-input")))
:reagent-render
(fn []
[:input {:style
{:border "none"
:width (base 160)
:height (base 58)
:outline "none"
:font-size (base 24)
:color (if (and (>= @value 10)
(>= @doumi-doumi @value))
"#444" "#f00")
:text-align "center"}
:id "doumi-custom-input"
:type "number"
:step "1"
:min 10
:max @doumi-doumi
:on-input (fn [e]
(let [val (-> e .-target .-value)]
(when-not (empty? val)
(rf/dispatch [:doumi-coupon-set-custom-value
(js/parseInt val)])))
(if (and (>= @value 10)
(>= @doumi-doumi @value))
(rf/dispatch [:doumi-use-coupon-custom-valid true])
(rf/dispatch [:doumi-use-coupon-custom-valid false])))}])})))
Even I focused on the :input
by hand, the log messages are not printed on the Safari console.
are there still errors in the console. It could be that the errors are happening before component did mount gets called,
Yes, there are errors. But is that possible that the component was mounted but the component-did-mount
not called?
That's unlikely
Best to fix all the errors first,
although that said, it looks like https://medium.com/@brunn/autofocus-in-ios-safari-458215514a5f calling .focus in ios safari won't work :s
even if you get component-did-mount to fire ok
oh the firewall ?
the suggestion in the article is that although you can't call '.focus' on an input in ios safari, you can set a focused style for the element (using css) and scroll the element into view using element.scrollintoview. You just can't raise the keyboard because apple doesn't people doing that if the user not explicitly tapped on something
good luck
Hi, does http-xhrio
supports application/x-www-form-urlencoded
, I only found one example about multipart/form-data
, but my server only allows application/x-www-form-urlencoded
.
I think you can put whatever headers you like
multipart/form-data
should be added to :body
. But last time I asked the cljs-ajax
whether I can add application/x-www-form-urlencoded
params but get no answer.
not sure if you'd read @cmal "you must include ring.middleware.multipart-params/wrap-multipart-params in your ring handlers as js/FormData always submits as multipart even if you don't use it to submit files" https://github.com/JulianBirch/cljs-ajax
Yes, but what if my server refuse to handler formdata, but only allowed application/x-www-form-urlencoded
?
as pointed out clearly in the same docs, no other support is provided unless there is PR
how do i go about passing a static value into the second function of a dynamic subscription? for example, the parent-id
value in the following:
(reg-sub
::sub-tags
(fn [[_ parent-id]]
[parent-id (subscribe [::tags])])
(fn [[parent-id tags]]
"Filter tags based on the parent-id val"))
that fails because parent-id
isn't a reaction (which makes sense, it's an argument for the subscription itself)