I’ve got a newText object that is being used for input of a form while the actual newTextField is offscreen
I’m using a listeners to sync the two text values which I assume is how most people are doing forms with native fields if they want them to scroll.
Works fine in the simulator, just not on the iPad
Problem I’m having is that my fake textbox is one character behind the actual textbox
So if I type “Hello World”
Actual textbox shows “Hello World” while the fake text box shows “Hello Worl”
Functions
local function focusRealfield(e) target = e.target if e.phase == 'ended' then --move the screen up transition.to(wrapper,{ time=150, alpha=1, x=0, y= -342 }) native.setKeyboardFocus(target.realfield) end end local function updateFaker(e) target = e.target if e.phase == "editing" then target.fakefield.text = e.text elseif (e.phase == "submitted" or e.phase == 'ended') then --move screen back down if (wrapper.y == -342) then transition.to(wrapper,{ time=150, alpha=1, x=0, y=0 }) end end end
Listeners
fnameFieldBg:addEventListener('touch', focusRealfield) nameField:addEventListener('userInput', updateFaker)
Any help troubleshooting this would be appreciated. I’m not sure.