fix: disable animation on Reset button in game picker
Wrap selectedIds.removeAll() in withTransaction with disablesAnimations to prevent animation glitches when clearing all selections at once. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1056,7 +1056,11 @@ struct GamePickerSheet: View {
|
|||||||
ToolbarItem(placement: .cancellationAction) {
|
ToolbarItem(placement: .cancellationAction) {
|
||||||
if !selectedIds.isEmpty {
|
if !selectedIds.isEmpty {
|
||||||
Button("Reset") {
|
Button("Reset") {
|
||||||
selectedIds.removeAll()
|
var transaction = Transaction()
|
||||||
|
transaction.disablesAnimations = true
|
||||||
|
withTransaction(transaction) {
|
||||||
|
selectedIds.removeAll()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.foregroundStyle(.red)
|
.foregroundStyle(.red)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user