commit e25a779efb4788ca54ae140de46e7b75c984ee71
parent b4cbdfc8571b452ad780a4fbcf4818fc7b4194dc
Author: Michael Camilleri <[email protected]>
Date: Tue, 23 Jun 2026 04:11:55 +0900
Fix hardware-keyboard rebus entry on iPad
Entering a rebus with a hardware keyboard exposed two faults the
software-keyboard path hid. Typed letters arrived lowercase, because
textInputAutocapitalization only sets the on-screen keyboard's shift
state and has no effect on hardware input. The dimming scrim also left a
thin un-dimmed strip along the bottom of the screen, because without a
software keyboard nothing covered the bottom safe area that the top-only
ignoresSafeArea did not reach.
This commit uppercases the rebus buffer as it changes so fills are
capitalised regardless of input source, matching the existing
appendRebusLetter path, and extends the scrim across the bottom edge so
it reaches the screen edge whether or not a software keyboard is shown.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Diffstat:
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/Crossmate/Views/Puzzle/PuzzleView.swift b/Crossmate/Views/Puzzle/PuzzleView.swift
@@ -377,7 +377,10 @@ struct PuzzleView: View {
if session.isRebusActive {
Color.black.opacity(0.35)
- .ignoresSafeArea(edges: .top)
+ // Ignore the bottom edge too: with a hardware keyboard there
+ // is no software keyboard covering the bottom safe area, so a
+ // top-only scrim leaves an un-dimmed strip at the screen edge.
+ .ignoresSafeArea(edges: [.top, .bottom])
.contentShape(Rectangle())
.onTapGesture {
session.commitRebus()
@@ -615,6 +618,14 @@ private struct RebusModal: View {
.focused(isFocused)
.keyboardType(.asciiCapable)
.textInputAutocapitalization(.characters)
+ // .textInputAutocapitalization only sets the software keyboard's
+ // shift state; hardware-keyboard input arrives as typed. Uppercase
+ // the buffer directly so rebus fills are capitalised either way,
+ // matching the custom-keyboard path in appendRebusLetter.
+ .onChange(of: text) { _, newValue in
+ let upper = newValue.uppercased()
+ if upper != newValue { text = upper }
+ }
.autocorrectionDisabled()
.submitLabel(.done)
.onSubmit(onCommit)