fix(modal): keep focus in annotations section when moving up from first
item
This commit is contained in:
@@ -1841,11 +1841,13 @@ impl TaskDetailModal {
|
|||||||
|
|
||||||
pub fn scroll(&self, delta: i32, cx: &mut gpui::Context<Self>) {
|
pub fn scroll(&self, delta: i32, cx: &mut gpui::Context<Self>) {
|
||||||
let handle = &self.scroll_handle;
|
let handle = &self.scroll_handle;
|
||||||
|
|
||||||
let current = if delta > 0 {
|
let current = if delta > 0 {
|
||||||
handle.bottom_item()
|
handle.bottom_item()
|
||||||
} else {
|
} else {
|
||||||
handle.top_item()
|
handle.top_item()
|
||||||
};
|
};
|
||||||
|
|
||||||
let next = if delta > 0 {
|
let next = if delta > 0 {
|
||||||
current.saturating_add(1)
|
current.saturating_add(1)
|
||||||
} else {
|
} else {
|
||||||
@@ -1890,7 +1892,7 @@ impl TaskDetailModal {
|
|||||||
(Some(next_index), true)
|
(Some(next_index), true)
|
||||||
}
|
}
|
||||||
} else if i == 0 {
|
} else if i == 0 {
|
||||||
(None, false)
|
(None, true)
|
||||||
} else {
|
} else {
|
||||||
(Some(i - 1), true)
|
(Some(i - 1), true)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user