diff --git a/graph_node_renderer/tab_container_custom.gd b/graph_node_renderer/tab_container_custom.gd index 1fbfcf0..2dedab2 100644 --- a/graph_node_renderer/tab_container_custom.gd +++ b/graph_node_renderer/tab_container_custom.gd @@ -101,11 +101,11 @@ func is_empty() -> bool: ## Closes a tab at the index [param tab]. func close_tab(tab: int) -> void: + if !tab_bar.select_previous_available(): + tab_bar.select_next_available() content_container.get_child(tab).queue_free() _tab_metadata.remove_at(tab) tab_bar.remove_tab(tab) - if !tab_bar.select_previous_available(): - tab_bar.select_next_available() tab_closed.emit(tab) if tab_bar.tab_count == 0: _previous_active_tab = -1