How do you use returnKeyLabel? - react-native

I used returnKeyLabel instead of returnKeyType, but it doesn't work at all.
I tried it on Android, and used a fixed value such as 'go'.
Could it be a problem with the device?
tell me your opinions.

Related

TextInput that only accepts certain input of user without flickering issues

I have a textinput lets say :
<TextInput
maxLength={5}
onChangeText={val => {
setExpiry(val.replace(/[^0-9]/g, ''));
}}
placeholder="Input"
value={Expiry}
keyboardType={'default'}/>
I want to restrict user to only add numbers, or any specific format using regex or simple loops.
The above is achieved, working without any functional issues.
But what seems to be off about this method is that it takes a little time (1ms may be) when you enter something unwanted, it shows entered character then removes that character. Overall, this doesn't look that great when it comes to user experience.
What I have tried:
Loop through the input and remove unwanted characters
It works but is slow and give the above flickering issues.
Use regex to replace with empty string
It works and is better at performance than above method, but still it gives the flickering issue.
So My question is that
is there any other way to have the same text box as on a native platform that doesn't have this flickering issue.
For Example: On native android, this issue is not faced.
References:
Regexp with textinput
Loop with textinput
Issue in GitHub repo
Handling TextInput Docs
If the requirement is to allow only numbers, using keyboardType='numeric' will eliminate everything besides numbers (and some punctuation on Android, see the docs on TextInput). Your regex solution will still be required to prevent non-number content, but it should be used less this way.
Have you tested your flickering issue on a release build of your app? The debug version will always be slower, and the flickering problem may not exist in a release build.

Fonts getting cut down in react native on One Plus, Oppo etc

I am facing a very rare and unseen issue that the fonts are getting worn out on some of the devices like the One Plus, Oppo etc.
I don't know what's the reason behind that. But this is a device specific issue on some devices only.
Well, If anyone comes across the same problem I have the solution for them :
Add a space " " at the end of the text
Give the Text a set width.
There is a proposed component at the bottom of the issue.
You can refer to this react native issue link
Also, this expo link helps
But, my main concern is these all are hacks. Is there any rock solid answer to solve these things? Why to do extra work, why can't react native solve that? Or are there any permanent solutions to fix this?
Please don't mark it as duplicate. I have the answer, I want to know the reason or any global answer to solve that in one go. I dont want to change all my 1000 text styles. :(

React Native TouchableNativeFeedback

Using React-Native has a long press error
Using TouchableHighlight And TouchableNativeFeedback
Attempted to transition from state RESPONDER_INACTIVE_PRESS_IN to RESPONDER_ACTIVE_LONG_PRESS_IN
My code
This issue usually only appears in android when you are debugging.
This issue https://github.com/facebook/react-native/issues/5823 goes into further detail.
Try turning debugging off and see if you still get the error.
Aligning the clocks on your phone and computer may solve this problem. My experience is that the two clocks do not need to be exact match, just make sure they are not off by more than a few seconds. You can easily achieve this by adjusting one clock manually.
Yes the same issue I faced it, after a much more research I found its's solution that instead of using TouchableHighlight, you can use TouchableOpacity component .
For detail refer this link -
http://androidseekho.com/others/reactnative/how-to-solve-touchable-longpressdelaytimeout-problem-in-react-native/

An unexpected error occurred during export

I am using Adobe Flash Professional CC to convert flash games to HTML5.
When i export my animation an error pop up saying "a JavaScript error occurred", and in the output "An unexpected error occurred during export. [JSX]".
I search for an answer got few results on it including http://community.createjs.com/. But none of it solves the problem.
For me, the problem was due to some Advanced Color Effects applied to the symbol (the ones where you mix alpha and RGB channels settings together). If I use effect styles like alpha or brightness, it works ok.
I had the same problem. For me the fix was just deleting one of my symbols from my stage.. When it was in my library it published fine, but bringing it to the stage gave me that error.
It seems that HTML5 canvas really doesn't like to support certain art assets. I had the same problem, but I realised that certain of my art elements had been created in Illustrator, with masks and paths. Once I got rid of them things started working properly
I recently struggled with this desperately trying to work out what was causing the problem.
The answer was a custom easing curve set on a particular tween in a particular MovieClip.
Incredibly hard to isolate, by deleting aspects of the project one by one.
Apparently that curve didn't play well. Weird thing is that I never defined a custom easing curve there, pretty sure. This may be the result of a CC update changing curve presets?

Getting "Undefined" reading logicalDensityFactor on Android

I'm testing a Titanium App on an Android emulator.
I use dip units, so i need to know the Ti.Platform.displayCaps.logicalDensityFactor to get the propers numbers.
But when I try to read:
Ti.Platform.displayCaps.logicalDensityFactor
Ti.Platform.displayCaps.xdpi
Ti.Platform.displayCaps.ydpi
I get undefined everytime!
Someone knows why this happen to me? is the emulator or what?
Thank you
Found the solution!
The string is Case Sensitive and Titanium don't generate any error if you write it wrong.
Another problem is that Titanium suggest me
Ti.Platform.DisplayCaps
and not with a lower "D"
Ti.Platform.displayCaps
So if you get this error, make sure that you had write correctly the string!