Fork me on GitHub
#cljsrn
<
2017-08-18
>
pesterhazy14:08:55

Does anyone have experience/advice about reacting to on-screen keyboard visibility so that the keyboard doesn't obscure the current input field ?

pesterhazy14:08:50

right, I know that exists

pesterhazy14:08:58

is that a 100% solution in your experience?

pesterhazy14:08:20

I tried it randomly in a form and it didn't do anything

vikeri14:08:33

Are you on Android or iOS?

pesterhazy14:08:34

do you know what the conditions are for this to work?

vikeri14:08:02

Ok, yeah it was a little tricky to get right the first time

pesterhazy14:08:33

is it a requirement that all input fields are direct children of the ScrollView?

vikeri14:08:55

Hmm, I don’t think so

vikeri14:08:21

These are my props:

{:behavior "height"
     :style    {:flex               1
                :justify-content    "center"
                :align-items        "center"
                :padding-horizontal 20
                :padding-top        20"}}

pesterhazy14:08:25

I guess I don't really understand how it works, and the docs are stenographic

pesterhazy14:08:19

I'll give it another try and report back

zlrth16:08:10

i’m working on this too. i naively replaced all views with keyboard-avoiding-views and nothing happened. makes sense; i haven’t set OnKeyboardChange or anything. i’m gonna fiddle around with it…

pesterhazy16:08:28

once you drop in that library, it handles the keyboard automagically for you

di16:08:14

I’ve used https://github.com/APSL/react-native-keyboard-aware-scroll-view in production and found that it works well

di16:08:33

(on both android and ios)

wojciech20:08:12

In my experience the workflow to getting KeyboardAvoidingView to work is: Step 1. You add the compoentn Step 2. You randomly go through all the possible prop values for behaviour Step 3. If this still doesn't work you randomly change styles in container elements in your screen and go back to Step 2. Step 4. Get a drink in the bar…

pesterhazy20:08:01

are things any better in plain ios/objectivec?

wojciech07:08:26

It's even worse. There you have to handle it by hand from scratch. Crazy…

manu09:08:41

There is written also the solution for android

lepistane16:08:11

is react native prerequisite to make apps with CLJS ?

mfikes16:08:14

No. But it is probably a great way to do it @lepistane . Others have written iOS apps with ClojureScript prior to React Native. One example way is https://github.com/mfikes/goby

mfikes16:08:24

And, if you are considering a game, I’d argue that React Native might not be the best fit, at least for fast-action canvas rendering. In that case, you could consider Ejecta http://blog.fikesfarm.com/posts/2017-04-29-clojurescript-ejecta.html

mfikes16:08:31

Even then, it is possible to build a game with React Native. I did one recently: http://fikesfarm.com/vocabulario (it employs mild use of animations)

lepistane18:08:09

wow great! thank you

scknkkrer23:08:25

Any stable navigation library for re-natal or directly cljs->js ?

zlrth16:08:10

i’m working on this too. i naively replaced all views with keyboard-avoiding-views and nothing happened. makes sense; i haven’t set OnKeyboardChange or anything. i’m gonna fiddle around with it…