From b2812824ed5c87a9c5aa9a0c9c4bd752a83bb7c1 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Thu, 19 Dec 2024 10:06:09 +0800 Subject: [PATCH] Do nothing if last active ix is same. --- crates/ui/src/dock/tab_panel.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ui/src/dock/tab_panel.rs b/crates/ui/src/dock/tab_panel.rs index f0bd4159..746be62b 100644 --- a/crates/ui/src/dock/tab_panel.rs +++ b/crates/ui/src/dock/tab_panel.rs @@ -165,6 +165,10 @@ impl TabPanel { } fn set_active_ix(&mut self, ix: usize, cx: &mut ViewContext) { + if ix == self.active_ix { + return; + } + let last_active_ix = self.active_ix; self.active_ix = ix;