Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26372] iOS: Assigning text value in change event causes duplicated input on TextView

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-09-13T07:25:19.000+0000
Affected Version/sRelease 7.3.1
Fix Version/sRelease 7.5.0
ComponentsiOS
Labelsn/a
ReporterJan Vennemann
AssigneeJan Vennemann
Created2018-09-08T09:44:59.000+0000
Updated2018-09-13T12:42:23.000+0000

Description

*Steps to reproduce the behavior* Add the following code to your app.js of a classic project:
var win = Ti.UI.createWindow({
    backgroundColor: '#fff'
});
const textArea = Ti.UI.createTextArea({
	backgroundColor: 'lightgray',
	height: 100,
	width: 200
});
textArea.addEventListener('change', (e) => {
	// This will trigger an additional change event and duplicate input
	textArea.value = e.value;
});
win.add(textArea);
win.open();
*Actual behavior* Any input will be duplicated in the TextView itself. For example pressing 'H' will result in 'HH' appearing in the TextView. *Expected behavior* The value of the text view can be assigned without any side effects. *Additional notes* This is required for the two-way binding in Vue.js. The iOS TextField does not have this issues, neither does any of the text widgets on Android.

Comments

  1. Samir Mohammed 2018-09-13

    *Closing ticket.* Verified improvement in SDK version: 7.5.0.v20180913035354. Assigning text value in change event no longer causes duplicated input on TextView. *FR Passed (Test Steps):*

    Created a new Titanium application

    Added the code above in to the application

    Installed app on to the device

    Ran the app

    Entered text in to the textview

    No longer saw duplicated text

    *Environment*
       APPC Studio:  5.1.0.201808080937
       APPC CLI: 7.0.6
       iphone 6 (12.0)
       Operating System Name: Mac OS High Sierra
       Operating System Version: 10.13.6
       Node.js Version: 8.9.1
       Xcode 10.0 beta 6
       

JSON Source