Skip to content

Commit 91cc627

Browse files
committed
Preserve the same button height in loading state with label opacity 0.
1 parent b9d755e commit 91cc627

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

WooCommerce/Classes/POS/Presentation/Reusable Views/Buttons/POSButtonStyle.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ private struct POSButton: View {
5151
var body: some View {
5252
Group {
5353
containerView {
54-
if isLoading {
55-
progressView
56-
} else {
54+
ZStack(alignment: .center) {
5755
configuration.label
56+
.opacity(isLoading ? 0 : 1)
57+
progressView
58+
.renderedIf(isLoading)
5859
}
5960
}
6061
}

0 commit comments

Comments
 (0)