Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1707] TextField property "value" generate a bug in iOS

GitHub Issuen/a
TypeBug
PriorityHigh
StatusResolved
ResolutionNot Our Bug
Resolution Date2019-11-07T22:17:01.000+0000
Affected Version/sAlloy 1.14.1
Fix Version/sn/a
Componentsn/a
LabelsACF, en
ReporterNazmus Salahin
AssigneeNazmus Salahin
Created2019-10-11T05:42:01.000+0000
Updated2019-11-07T22:17:01.000+0000

Description

Just found a rather odd bug using a textfield. Looks like it refuses to take a value of 86.6 instead setting it to 86.599999999 *Test Environment:*
Appcelerator Command-Line Interface, version 7.0.12
Operating System
  Name                        = Mac OS X
  Version                     = 10.13.6
  Architecture                = 64bit
  # CPUs                      = 4
  Memory                      = 8589934592
Node.js
  Node.js Version             = 10.16.3
  npm Version                 = 6.9.0
Titanium CLI
  CLI Version                 = 5.1.1
Titanium SDK
  SDK Version                 = 8.2.0.GA
  Target Platform             = iphone
*Test code:* *Index.xml*
<Alloy>
	<Window layout="vertical">
		<TextField top="50" value="86.6" id="Text1" onClick="onClick" width="80%"/>
	</Window>
</Alloy>
*Index.js*
function onClick() {
	Ti.API.info('@@@ Setting focus');
	alert($.Text1.getValue());
}

$.index.open(); 
*Test result:* See the attachment section. *Test steps:* 1. Open Appcelerator studio and create an alloy project. 2. Add index.xml and index.js in the project. 3. Run the project with iOS 13 or iOS 12 device or simulator.

Attachments

FileDateSize
Screenshot 2019-10-23 at 12.08.29 AM.png2019-10-22T18:46:39.000+000042971
Simulator Screen Shot - iPhone X - 2019-10-11 at 11.34.27.png2019-10-11T05:35:09.000+000069418

Comments

  1. Vijay Singh 2019-10-11

    A quick workaround is set the value in "index.js" instead of "index.xml". index.xml
       <Alloy>
         <Window layout="vertical">
           <TextField top="50" id="Text1" onClick="onClick" width="80%"/>
         </Window>
       </Alloy>
       
    index.js
       function onClick() {
       	Ti.API.info('@@@ Setting focus');
       	alert($.Text1.getValue());
       }
        
       $.Text1.value = "86.6";
       $.index.open();
       

JSON Source