I’ve worked around the problem so that I can release using build 1259. Here’s my workaround. Self in this case is an object that contains a created nativeTextField in self.nativeTextField, and self.text holds the correct value of the text across editing events:
-- Workaround for bug in build 1259. -- There is a special case of backspacing a secure field that wipes all the chars out. -- Don't do the bug fix for secure fields. local fixedText = event.text if (not self.isSecure) and event.oldText and ( type( event.oldText ) == "string" ) and ( event.startPosition \> 0 ) and event.newCharacters and ( type( event.newCharacters ) == "string" ) then if event.newCharacters:len() == 0 then -- This was a delete action. The start position will be -- the location of the cursor AFTER the deleted characters were deleted. -- Delete characters at the start position + 1 -- based on the difference in length of -- the new (probably wrong) text and the old text. local charCount = event.oldText:len() - event.text:len() if charCount \> 0 then fixedText = self.text:sub( 1, event.startPosition - 1 ) .. self.text:sub( event.startPosition + charCount ) end else -- Characters were typed, so add them in the right place. -- Here, start position is the position BEFORE the characters were added. fixedText = self.text:sub( 1, event.startPosition - 1 ) .. event.newCharacters .. self.text:sub( event.startPosition ) end print( "fixing the bug, forcing " .. fixedText ) end self:setText( fixedText )