macOS: command pallete scroll improvements

Removes the withAnimation closure which caused flashing when scrolling
up or down with arrow keys. Also removes the center anchor to behave
more like other command palletes (e.g., Zed, Raycast).
This commit is contained in:
Friedrich Stoltzfus 2025-04-22 16:12:09 -04:00
parent 17b0bf585d
commit b4b2b10328

View File

@ -177,11 +177,8 @@ fileprivate struct CommandTable: View {
.frame(maxHeight: 200)
.onChange(of: selectedIndex) { _ in
guard selectedIndex < options.count else { return }
withAnimation {
proxy.scrollTo(
options[Int(selectedIndex)].id,
anchor: .center)
}
proxy.scrollTo(
options[Int(selectedIndex)].id)
}
}
}