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

fix(android): fix event from already active tab in bottom style TabGroup #11304

Merged
merged 2 commits into from Apr 17, 2020

Conversation

ypbnv
Copy link
Contributor

@ypbnv ypbnv commented Oct 30, 2019

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

Description:
Selecting an already active tab in a TabGroup with the bottom style navigation fires the selected
event for the tab. This does not match the default style.
Note: This only happens when a user clicks on the TabController. Calling setActiveTab() does not trigger the redundant event, so we can't have a unit test for the scenario.

Test case:
app.js

var mainWin = Ti.UI.createWindow({ layout: 'vertical' }),
	defaultTabGroup = Ti.UI.createTabGroup({ tabs: [createTab('Def1'), createTab('Def2')] }),
	bottomStyleTabGroup = Ti.UI.createTabGroup({ tabs: [createTab('Bot1'), createTab('Bot2')],
		style: Ti.UI.Android.TABS_STYLE_BOTTOM_NAVIGATION }),
	button1 = Ti.UI.createButton({ title: 'Default' }),
	button2 = Ti.UI.createButton({ title: 'Bottom Style' });
button1.addEventListener('click', function() {
	defaultTabGroup.open();
});
button2.addEventListener('click', function() {
	bottomStyleTabGroup.open();
});
mainWin.add([button1, button2]);
mainWin.open();

function createTab(title) {
	var newWindow = Ti.UI.createWindow();
	var tab = Ti.UI.createTab({ title: title,
		window: newWindow });
	tab.addEventListener('selected', function(e) {
		Ti.API.info('Tab selected');
	});
	return tab;
}

Selecting an already active tab in a TabGroup with the bottom style navigation fires the selected
event for the tab. This does not match the default style.
@ypbnv ypbnv added this to the 9.0.0 milestone Oct 30, 2019
@build build requested a review from a team October 30, 2019 15:32
@build
Copy link
Contributor

build commented Oct 30, 2019

Messages
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 6636 tests are passing.
(There are 697 skipped tests not included in that total)

Generated by 🚫 dangerJS against 7d2163f

@JOSHUASTJOHN
Copy link

Can someone please tell me how to use this GitHub. I don't even have the slidest idea what it is

@ewanharris ewanharris modified the milestones: 9.0.0, 9.1.0 Feb 12, 2020
@ssjsamir ssjsamir self-requested a review April 7, 2020 14:05
Copy link
Contributor

@ssjsamir ssjsamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR Passed: Using the test case provided above. Unable to see redundant events.

Environment

MacOS Catalina: 10.15.5 Beta 
Xcode: 11.4
Java Version: 1.8.0_131
Android NDK: 21.1.6273396-beta2
Node.js: 10.16.3
""NPM":"5.0.0-1","CLI":"8.0.0-master.10""
Android API 25 Sim

@sgtcoolguy sgtcoolguy merged commit 1e80f47 into tidev:master Apr 17, 2020
sgtcoolguy pushed a commit that referenced this pull request Apr 17, 2020
…oup (#11304)

Selecting an already active tab in a TabGroup with the bottom style navigation fires the selected
event for the tab. This does not match the default style.

Fixes TIMOB-27513
@build build mentioned this pull request May 15, 2020
3 tasks
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

6 participants