Skip to content

Commit

Permalink
Fix the overlapping scrollbars on macOS. (#3646)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave authored Dec 20, 2024
1 parent 536f01a commit b8106f3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ struct RoomListFiltersView: View {
@Binding var state: RoomListFiltersState
@Namespace private var namespace

/// When you connect a mouse on macOS the scrollbars aren't hidden. This is some extra padding
/// applied to the scroll view content to make sure the bars don't overlap the filters.
private var macScrollBarPadding: CGFloat { ProcessInfo.processInfo.isiOSAppOnMac ? 16 : 0 }

var body: some View {
ScrollViewReader { proxy in
ScrollView(.horizontal) {
Expand Down Expand Up @@ -39,11 +43,13 @@ struct RoomListFiltersView: View {
.matchedGeometryEffect(id: filter.id, in: namespace)
}
}
.padding(.horizontal, 16)
.padding(.bottom, macScrollBarPadding)
}
}
.scrollIndicators(.hidden)
.padding(.leading, 16)
.padding(.vertical, 12)
.padding(.bottom, -macScrollBarPadding)
}
}

Expand Down

0 comments on commit b8106f3

Please sign in to comment.