Widen macOS amount fields so large values don't clip
NumericField's macOS-only frame was hard-capped at 140pt, but the app's own max BTC supply (21,000,000) means Sats amounts can reach a ~21-character grouped string, which didn't fit — the field visibly clipped once typed input exceeded the cap. Lets it grow up to 220pt instead of a fixed 140pt. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
This commit is contained in:
@@ -351,7 +351,12 @@ private struct NumericField: View {
|
||||
#endif
|
||||
.multilineTextAlignment(alignment)
|
||||
#if os(macOS)
|
||||
.frame(maxWidth: 140)
|
||||
// Bounded rather than unconstrained so the field doesn't grow to fill the whole row
|
||||
// (the original reason for a fixed width here), but wide enough for the largest
|
||||
// values this app actually displays — e.g. a Sats amount at the max BTC supply
|
||||
// (`maxSupplyBtcAmount` * 100,000,000) is a 16-digit, comma-grouped ~21-character
|
||||
// string, which a 140pt cap was clipping.
|
||||
.frame(minWidth: 80, idealWidth: 140, maxWidth: 220)
|
||||
#endif
|
||||
.onAppear { text = NumberFormatKt.groupDigits(value: value) }
|
||||
.onChange(of: text) { newValue in
|
||||
|
||||
Reference in New Issue
Block a user