Skip to content

fix(android): Ti.UI.Tab selected event returns no data#14004

Merged
cb1kenobi merged 1 commit intomasterfrom
androidTabSelected
May 13, 2024
Merged

fix(android): Ti.UI.Tab selected event returns no data#14004
cb1kenobi merged 1 commit intomasterfrom
androidTabSelected

Conversation

@m1ga
Copy link
Contributor

@m1ga m1ga commented Mar 7, 2024

Currently the Ti.UI.Tab selected event doesn't return the values it should be according to the docs. The issue is that the data is set to null instead of focusEventData

Test

var win1 = Ti.UI.createWindow();
win1.add(Ti.UI.createLabel({text: 'I am a blue window.'}));

var win2 = Ti.UI.createWindow();
win2.add(Ti.UI.createLabel({text: 'I am a red window.'}));

var tab1 = Ti.UI.createTab({
    window: win1,
    title: 'Blue'
}),
tab2 = Ti.UI.createTab({
    window: win2,
    title: 'Red'
}),
tabGroup = Ti.UI.createTabGroup({
    tabs: [tab1, tab2]
});

tab1.addEventListener("selected", function(e){
  console.log(e.index, e.previousIndex)
})
tab2.addEventListener("selected", function(e){
  console.log(e.index, e.previousIndex)
})

tabGroup.open();

Copy link
Contributor

@cb1kenobi cb1kenobi left a comment

Choose a reason for hiding this comment

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

Tested and works great! Thanks! APPROVED

@cb1kenobi cb1kenobi merged commit 90c4d1f into master May 13, 2024
@m1ga m1ga deleted the androidTabSelected branch May 29, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants