I am making a text field on a Google Nexus 4.
Upon hitting the go button the event.phase == “submitted” is being called two times and the event.phase == “ended” is being called once. All on the submission of my text input.
I should mention that this worked fine until I upgraded to the latest build of corona.
Any idea what is going on? And even if it where not calling submitted twice, why is it calling both submitted and ended?
Out put is
–>POPUP Submitted!
–>POPUP Submitted!
–>POPUP Ended!
Relevant code is:
--Text listener for Raiding Party name local function textListener( event ) local newSceneOptions if ( event.phase == "began" ) then transition.to(popUpWindow, { time = popUpVars.transitionTime, y = popUpVars.popUpWindowPositionXY[2] - popUpVars.positionTransitionOffset, transition = easing.outCubic, }) -- user begins editing text field print( event.text ) elseif ( event.phase == "ended" ) then print("POPUP Ended!") -- text field loses focus transition.to(popUpWindow, { time = popUpVars.transitionTime, y = popUpVars.popUpWindowPositionXY[2], transition = easing.outCubic, }) native.setKeyboardFocus( nil ) startButtonGroup.startButton:setEnabled( true ) elseif ( event.phase == "submitted" ) then print("POPUP Submitted!") transition.to(popUpWindow, { time = popUpVars.transitionTime, y = popUpVars.popUpWindowPositionXY[2], transition = easing.outCubic, }) native.setKeyboardFocus( nil ) startButtonGroup.startButton:setEnabled( true ) end end if systemOs ~= "Win" then --Create text field textInputField = native.newTextField( .5\*popUpWindow.popUpBackground.width, popUpVars.textWindowPositionY, gameUi.menusImageVars.textWindowWidthHeight[1], 50 ) textInputField.placeholder = "name" textInputField.align = "center" --textInputField.text = "Fabel Gullie" textInputField.size = 20 textInputField.hasBackground = false --textInputField.font = native.newFont( "lootRaiders2", popUpVars.textPosition2FontSize ) textInputField:setTextColor( 0, 0, 0 ) textInputField:setReturnKey("go") textInputField:addEventListener( "userInput", textListener ) popUpWindow:insert( textInputField ) else --This must be on windows transitionTest() end