Skip to content

Commit

Permalink
Make whole Ghost button tappable
Browse files Browse the repository at this point in the history
  • Loading branch information
dus7 committed Apr 10, 2024
1 parent 47d3286 commit 58d78da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions LocalPackages/DuckUI/Sources/DuckUI/Button.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public struct GhostButtonStyle: ButtonStyle {
.frame(minWidth: 0, maxWidth: .infinity, maxHeight: Consts.height)
.background(backgroundColor(configuration.isPressed))
.cornerRadius(Consts.cornerRadius)
.contentShape(Rectangle()) // Makes whole button area tappable, when there's no background
}

private func foregroundColor(_ isPressed: Bool) -> Color {
Expand Down

0 comments on commit 58d78da

Please sign in to comment.