Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-7618] Android: Text field loses focus when changing orientation #9515

Closed
wants to merge 5 commits into from

Conversation

maggieaxway
Copy link
Contributor

@maggieaxway maggieaxway commented Oct 10, 2017

[TIMOB-7618] Android: Text field loses focus when changing orientation
Update TiTableView.java

JIRA: https://jira.appcelerator.org/browse/TIMOB-7618

The changes only removed the blur event but not the focus event when change orientation

Test case:

var win = Ti.UI.createWindow({

softInputMode : (Titanium.UI.Android) ? Ti.UI.Android.SOFT_INPUT_ADJUST_PAN : '',
windowSoftInputMode : (Titanium.UI.Android) ? Ti.UI.Android.SOFT_INPUT_ADJUST_PAN : ''
});
 
var tf1 = null;
 
function addRow() {
var row = Ti.UI.createTableViewRow({
height : 80,
//touchEnabled:false
});
 
tf1 = Titanium.UI.createTextField({
color : '#336699',
width : 250,
height : 80,
focusable : true,
returnKeyType : Titanium.UI.RETURNKEY_DONE,
//autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_WORDS,
autocorrect : false,
suppressReturn : true,
 
});
 
tf1.addEventListener('focus', function() {
Ti.API.info('Focus fired');
alert('Focus fired');
});
 
tf1.addEventListener('blur', function() {
Ti.API.info('blur fired');
alert('Blur fired');
});
 
row.add(tf1);
//row.selectionStyle = Ti.UI.iPhone.TableViewCellSelectionStyle.NONE;
//row.className = 'control';
return row;
}
 
// create table view data object
var data = [];
 
for(var x = 0; x < 10; x++) {
data[x] = addRow();
}
 
var tableView = Ti.UI.createTableView({
data : data,
//style : Titanium.UI.iPhone.TableViewStyle.GROUPED
});
 
win.add(tableView);
 
win.open();

[TIMOB-7618] Android: Text field loses focus when changing orientation
Update TiTableView.java
@maggieaxway maggieaxway added this to the 7.0.0 milestone Oct 10, 2017
@build
Copy link
Contributor

build commented Oct 11, 2017

Fails
🚫

Tests have failed, see below for more information.

Warnings
⚠️

🔬 There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code

Tests:

Classname Name Time Error
android.Titanium.Locale #getString(String, String) with default/hint value 0.001 TypeError: utilities.isiOS is not a function
ios.Titanium.Database execute() returns null instead of empty result set 0.007 file:///Users/build/Library/Developer/CoreSimulator/Devices
ios.Titanium.Locale #getString(String, String) with default/hint value 0.048 [native code]
file:///Users/build/Library/Developer/CoreSimulator/Devices/6ED2D1

Generated by 🚫 dangerJS

@sgtcoolguy sgtcoolguy modified the milestones: 7.0.0, 7.1.0 Nov 30, 2017
@sgtcoolguy
Copy link
Contributor

We've branched 7_0_X now. If this is a bug fix, we'll need a backport/cherry-pick against 7_0_X now too.

@maggieaxway maggieaxway removed this from the 7.1.0 milestone Jan 3, 2018
@build build added this to the 8.1.0 milestone Jan 15, 2019
@build build requested a review from a team January 15, 2019 13:47
@build
Copy link
Contributor

build commented Jan 15, 2019

Fails
🚫

🔬 There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code, but will require an admin to merge this PR. Please see README.md#unit-tests for docs on unit testing.

🚫

😥 npm test failed. See below for details.

Warnings
⚠️

🔍 Can't find junit reports at ./junit.*.xml, skipping generating JUnit Report.

Messages
📖 🎉 Another contribution from our awesome community member, maggieaxway! Thanks again for helping us make Titanium SDK better. 👍
📖
> titanium-mobile@8.1.0 test /Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515
> grunt

Running "appcJs:src:lintOnly" (appcJs) task

Running "eslint:src" (eslint) task

/Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515/build/packager.js
316:17  warning  Avoid calling back inside of a promise  promise/no-callback-in-promise
317:19  warning  Avoid calling back inside of a promise  promise/no-callback-in-promise

/Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515/build/scons-xcode-test.js
27:3  warning  Each then() should return a value or throw  promise/always-return

/Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515/build/utils.js
154:3   warning  Avoid using promises inside of callbacks    promise/no-promise-in-callback
154:3   warning  Avoid using promises inside of callbacks    promise/no-promise-in-callback
154:63  warning  Each then() should return a value or throw  promise/always-return
155:4   warning  Avoid calling back inside of a promise      promise/no-callback-in-promise
157:4   warning  Avoid calling back inside of a promise      promise/no-callback-in-promise
175:59  warning  Each then() should return a value or throw  promise/always-return
176:4   warning  Avoid calling back inside of a promise      promise/no-callback-in-promise
178:4   warning  Avoid calling back inside of a promise      promise/no-callback-in-promise
189:3   warning  Avoid using promises inside of callbacks    promise/no-promise-in-callback
189:3   warning  Avoid using promises inside of callbacks    promise/no-promise-in-callback
189:51  warning  Each then() should return a value or throw  promise/always-return
190:4   warning  Avoid calling back inside of a promise      promise/no-callback-in-promise
192:4   warning  Avoid calling back inside of a promise      promise/no-callback-in-promise
203:71  warning  Each then() should return a value or throw  promise/always-return
205:4   warning  Avoid calling back inside of a promise      promise/no-callback-in-promise
206:17  warning  Avoid calling back inside of a promise      promise/no-callback-in-promise
218:71  warning  Each then() should return a value or throw  promise/always-return
220:4   warning  Avoid calling back inside of a promise      promise/no-callback-in-promise
258:10  warning  Each then() should return a value or throw  promise/always-return
261:18  warning  Avoid calling back inside of a promise      promise/no-callback-in-promise

/Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515/iphone/cli/commands/_build.js
6364:79  warning  'out' is defined but never used  no-unused-vars

/Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515/iphone/cli/hooks/frameworks.js
 61:5   warning  Expected catch() or return                  promise/catch-or-return
 61:34  warning  Avoid calling back inside of a promise      promise/no-callback-in-promise
428:5   warning  Each then() should return a value or throw  promise/always-return

✖ 27 problems (0 errors, 27 warnings)


Running "checkFormat:ios" (checkFormat) task

Running "checkFormat:android" (checkFormat) task
Fatal error: Error: Formatting incorrect on "android/modules/ui/src/java/ti/modules/titanium/ui/widget/tableview/TiTableView.java", proposed changes: <?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='false'>
<replacement offset='23705' length='1'>&#10;			</replacement>
<replacement offset='23775' length='1'>&#10;			</replacement>
<replacement offset='23795' length='1'>&#10;			</replacement>
<replacement offset='23850' length='1'>&#10;			</replacement>
</replacements>
�
npm ERR! Test failed.  See above for more details.

Generated by 🚫 dangerJS against 12f8f62

@sgtcoolguy sgtcoolguy modified the milestones: 8.1.0, 8.2.0 Jun 3, 2019
@sgtcoolguy sgtcoolguy modified the milestones: 8.2.0, 8.3.0 Sep 5, 2019
@build
Copy link
Contributor

build commented Sep 9, 2019

Fails
🚫

🔬 There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code, but will require an admin to merge this PR. Please see README.md#unit-tests for docs on unit testing.

🚫

😥 npm test failed. See below for details.

Warnings
⚠️

🔍 Can't find junit reports at ./junit.*.xml, skipping generating JUnit Report.

⚠️

Commit 1a5ecadba3476bc10d9be0481ae559d330cbc0b8 has a message "[TIMOB-7618] Android: Text field loses focus when changing orientation

[TIMOB-7618] Android: Text field loses focus when changing orientation
Update TiTableView.java" giving 2 errors:

  • subject may not be empty
  • type may not be empty
Messages
📖 🎉 Another contribution from our awesome community member, maggieaxway! Thanks again for helping us make Titanium SDK better. 👍
📖
> titanium-mobile@8.3.0 test /Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515
> npm run ios-sanity-check && grunt


> titanium-mobile@8.3.0 ios-sanity-check /Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515
> ./build/scons check-ios-toplevel

Running "eslint:lintOnly" (eslint) task

/Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515/build/lib/utils.js
331:6   warning  The 'require.resolve.paths' is not supported until Node.js 8.9.0. The configured version range is '>=8'  node/no-unsupported-features/node-builtins
332:20  warning  The 'require.resolve.paths' is not supported until Node.js 8.9.0. The configured version range is '>=8'  node/no-unsupported-features/node-builtins

/Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515/cli/lib/tasks/process-js-task.js
158:12  warning  Avoid calling back inside of a promise  promise/no-callback-in-promise
165:5   warning  Avoid calling back inside of a promise  promise/no-callback-in-promise

/Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515/common/Resources/ti.internal/extensions/node/buffer.js
64:5  warning  Missing JSDoc parameter description for 'arg'               valid-jsdoc
65:5  warning  Missing JSDoc parameter description for 'encodingOrOffset'  valid-jsdoc
66:5  warning  Missing JSDoc parameter description for 'length'            valid-jsdoc

/Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515/android/cli/commands/_build.js
3303:18  warning  'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead  node/no-deprecated-api

/Users/build/jenkins/workspace/nium-sdk_titanium_mobile_PR-9515/iphone/cli/hooks/frameworks.js
 60:5   warning  Expected catch() or return                       promise/catch-or-return
 60:34  warning  Avoid calling back inside of a promise           promise/no-callback-in-promise
 79:6   warning  Avoid wrapping return values in Promise.resolve  promise/no-return-wrap
425:5   warning  Each then() should return a value or throw       promise/always-return

✖ 12 problems (0 errors, 12 warnings)


Running "checkFormat:ios" (checkFormat) task

Running "checkFormat:android" (checkFormat) task
Fatal error: Error: Formatting incorrect on "android/modules/ui/src/java/ti/modules/titanium/ui/widget/tableview/TiTableView.java", proposed changes: <?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='false'>
<replacement offset='23478' length='1'>&#10;			</replacement>
<replacement offset='23548' length='1'>&#10;			</replacement>
<replacement offset='23568' length='1'>&#10;			</replacement>
<replacement offset='23623' length='1'>&#10;			</replacement>
</replacements>
�
npm ERR! Test failed.  See above for more details.

📖

🚨 This PR has one or more commits with warnings/errors for commit messages not matching our configuration. You may want to squash merge this PR and edit the message to match our conventions, or ask the original developer to modify their history.

Generated by 🚫 dangerJS against 82ff28b

@sgtcoolguy sgtcoolguy removed this from the 8.3.0 milestone Dec 10, 2019
@hansemannn hansemannn closed this Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants