[TIMOB-18099] iOS: Parity: Clean up tab events
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-10-22T02:01:23.000+0000 |
Affected Version/s | Release 3.5.0 |
Fix Version/s | Release 5.1.0 |
Components | iOS |
Labels | TCSupport |
Reporter | Mark Mokryn |
Assignee | Angel Petkov |
Created | 2014-11-06T16:06:13.000+0000 |
Updated | 2016-02-15T13:50:48.000+0000 |
Description
1. In Android we have the click event on the tab, but in iOS we do not. This event should be removed for Android as well, since it's confusing and quite useless as tabs can be selected by swipes.
2. In Android since 3.5.0 we have the tab selected and unselected events. In iOS we have focus/blur which fire exactly when the tab is selected and unselected. So iOS tab focus/blur should be renamed selected/unselected to match Android.
3. Tab focus/blur should be removed since we have selected/unselected which are much clearer, and since it makes no sense for tabs to be focused/blurred. Focus/blur events should occur on the Window or perhaps on the entire tab group, but not for "tabs" which are only used for selection and are not really a containing UI element. Note that for Android tab focus/blur fire in numerous cases, not just tab selection, and in all "relevant" cases we have Window focus/blur in any case so for tabs they're redundant.
[~cng] In SDK 4.1.0 and 5.0.0 at least, the
focus
andblur
events for iOS don't even include theindex
,previousIndex
,tab
andpreviousTab
properties that the docs say it has, so they are useless. We should indeed bring theselected
andunselected
events to iOS.*PR* https://github.com/appcelerator/titanium_mobile/pull/7239#issuecomment-143895561 DemoCode:
Thanks [~apetkov], PR reviewed and merged!
Verified as fixed, using the demo code provided by [~apetkov] I am able to see the deprecated messages for focus / blur when selecting tabs. Confirmed as working for iOS9 simulator & device. OSX El Capitan 10.11 Studio: 4.3.1.201509302304 Ti SDK: 5.2.0.v20151009071418 Appc NPM: 4.2.1-1 Appc CLI: 5.1.0-38
Verified fixed, using: MacOS 10.11.2 (15C27e) Studio 4.4.0.201510280736 Ti SDK 5.1.0.v20151028190028 Appc NPM 4.2.1 Appc CLI 5.1.0-38 Ti CLI 5.0.5 Alloy 1.7.16 Arrow 1.3.13 Xcode 7.2 (7C46l) Node v0.12.7 Java 1.7.0_80 production Deprecation messages appear for blur/focus events and parity will be achieved with the linked, related ticket
This implementation we now have doesn't make much sense... When the TabGroup opens
unselected
and thenselected
are both fired. Only the last one could make sense, although I'd say the initial state should not fire events:I guess best is to resolve TIMOB-19759 and then deprecate>remove these.