focusedTabItem
Description
Observable field that emits the current tab index when focus changes within the panel.
Type
integer
Usage
m.lib.observeField("focusedTabItem", "onFocusedTabItem")
function onFocusedTabItem(event as Object)
focusedIndex = event.getData()
print "Current Focused Tab Index: " + focusedIndex.toStr()
end function
Example
sub setupPanelObservers()
m.lib.observeField("focusedTabItem", "onFocusedTabItem")
end sub
function onFocusedTabItem(event as Object)
focusedIndex = event.getData()
if focusedIndex <> invalid then
print "User focused tab at index: " + focusedIndex.toStr()
' Perform actions based on focused tab
if focusedIndex = 0 then
print "Key Plays tab is focused"
else if focusedIndex = 1 then
print "Stats tab is focused"
else if focusedIndex = 2 then
print "Bet tab is focused"
end if
end if
end function
Best Practices
- Use this to track user navigation within panels
- Implement tab-specific logic based on focus
- Track which tabs users engage with most