mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-05-05 15:33:00 +00:00
macOS: Command Pallete Improvements (#7171)
As discussed in #7165, this PR resolves two issues with the command pallete on macOS. 1. The flashing of a command passing out of view was caused by the `withAnimation` function. Removing this closure resolved this issue. 2. The current implementation kept the selected command anchored to the middle of the pallete. However, most command pallates allow you to key through the visible options, only scrolling when your selection hits the boundary. I resolved this by removing the `anchor: .center` parameter for the `scrollTo` command.
This commit is contained in:
commit
f2c798d319
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user