You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When opening a scene from a previous version with a TabBar that does not have the current_tab property set (default), the default tab for a TabBar will not be set to the first tab.
This is because TabBar::set_tab_count will set the current tab to -1 if the current tab was not set before tabs were added. This can be seen by calling the set_tab_count() manually as well.
Also related:
In TabContainer and TabBar (if there are no tabs set in the inspector), setting the current tab to an invalid value does not show error or do anything. Calling TabBar::set_tab_count afterwards will set current tab to that invalid value. It also will not emit a tab_changed signal or update the previous tab.
Tested versions
v4.3.stable.official [77dcf97], master
System information
Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 (NVIDIA; 31.0.15.5186) - Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (12 Threads)
Issue description
When opening a scene from a previous version with a TabBar that does not have the current_tab property set (default), the default tab for a TabBar will not be set to the first tab.
This is because
TabBar::set_tab_count
will set the current tab to -1 if the current tab was not set before tabs were added. This can be seen by calling theset_tab_count()
manually as well.Also related:
In TabContainer and TabBar (if there are no tabs set in the inspector), setting the current tab to an invalid value does not show error or do anything. Calling
TabBar::set_tab_count
afterwards will set current tab to that invalid value. It also will not emit a tab_changed signal or update the previous tab.TabBar
without deselect #88494This is because it assumes that
TabBar::set_tab_count
andTabBar::set_current_tab
will be called, but they may not be.So it looks like a regression from #88477
I am working on a comprehensive fix for this.
Steps to reproduce
For setting an invalid current tab:
current_tab = 100
or some invalid value. No error will be shown.set_tab_count(1)
.Minimal reproduction project (MRP)
tab_bar_current_tab_init_issue.zip
Three issues are shown in the MRP:
set_tab_count
.The text was updated successfully, but these errors were encountered: