TabBar current tab now stays -1 when adding first tab on deselect_enable

This commit is contained in:
Tiger Jove 2025-07-03 23:10:05 +02:00
parent 9b22b41531
commit c6c7b508b6
2 changed files with 24 additions and 6 deletions

View file

@ -1266,7 +1266,7 @@ void TabBar::add_tab(const String &p_str, const Ref<Texture2D> &p_icon) {
queue_redraw();
update_minimum_size();
if (tabs.size() == 1) {
if (!deselect_enabled && tabs.size() == 1) {
if (is_inside_tree()) {
set_current_tab(0);
} else {