Skip to content

Commit

Permalink
Remove the use of .focusSection
Browse files Browse the repository at this point in the history
Using `focusScope` has some pretty bad performance bottle-necks
when it comes to lazy collections because it will render the entire
list and through dequeuing out the window. This simply does not
work as we want.
  • Loading branch information
zenangst committed May 25, 2023
1 parent ec77b01 commit 0235f17
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions App/Sources/Views/ContentListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ struct ContentListView: View {
})
}
.focused($isFocused)
// This is a hack to avoid the extra padding that gets added when using `.focusSection`
.padding(.bottom, -8)
.focusSection()
.onChange(of: isFocused, perform: { newValue in
guard newValue else { return }

Expand Down
1 change: 0 additions & 1 deletion App/Sources/Views/EditableKeyboardShortcutsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ struct EditableKeyboardShortcutsView: View {
}
}
}
.focusSection()
.padding(4)
}
Spacer()
Expand Down
3 changes: 0 additions & 3 deletions App/Sources/Views/GroupsListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ struct GroupsListView: View {
.tag(group)
}
.focused($isFocused)
// This is a hack to avoid the extra padding that gets added when using `.focusSection`
.padding(.bottom, -8)
.focusSection()
.onChange(of: isFocused, perform: { newValue in
guard newValue else { return }

Expand Down
1 change: 0 additions & 1 deletion App/Sources/Views/WorkflowApplicationTriggerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ struct WorkflowApplicationTriggerView: View {
focusPublisher.publish(element.id)
}
}
.focusSection()
.onCommand(#selector(NSResponder.insertTab(_:)), perform: {
focus.wrappedValue = .detail(.commands)
})
Expand Down
1 change: 0 additions & 1 deletion App/Sources/Views/WorkflowCommandListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ struct WorkflowCommandListView: View {
}
}
.focused($isFocused)
.focusSection()
.onChange(of: isFocused, perform: { newValue in
guard newValue else { return }

Expand Down

0 comments on commit 0235f17

Please sign in to comment.