Skip to content

Fix clear button not working on scrolled text fields in CardFormViewController - #113

Merged
koutaku921 merged 1 commit into
payjp:masterfrom
bu-tokumitsu:fix/issue_110_textfiled_clear_bug
May 18, 2026
Merged

Fix clear button not working on scrolled text fields in CardFormViewController#113
koutaku921 merged 1 commit into
payjp:masterfrom
bu-tokumitsu:fix/issue_110_textfiled_clear_bug

Conversation

@bu-tokumitsu

Copy link
Copy Markdown
Contributor

概要

  • キーボード表示によりスクロールして表示されるテキストフィールドで、クリアボタン(×)をタップしても入力値が削除されない不具合
  • Fix keyboard scrolling in CardFormViewController #106 、修正の影響で発生

対応内容

  • 原因
    • UITapGestureRecognizer がクリアボタンのタップより先に発火し、view.endEditing(true)でキーボードを閉じてしまうため、クリアボタンのイベントがキャンセルされる。
  • 修正方針
    • UIGestureRecognizerDelegate の gestureRecognizer(_:shouldReceive:) を実装し、タッチ先が UITextField(またはそのサブビュー = クリアボタン)の場合はジェスチャーを無効にする。

関連Issues & PR

動作検証

修正前 修正後
issue_110_bef.mov
issue_110_aft.mov

@laiso

laiso commented May 16, 2026

Copy link
Copy Markdown
Contributor

変更内容確認しました。同様に以下の動作確認をしました。

  1. Card Form ViewController (Label) をタップ
  2. 表示されたカードフォームで 有効期限フィールドをタップ → キーボードが出てフォームがスクロール
  3. 任意の値を入力(例: 12/30)
  4. フィールド右端の × ボタンをタップ → 値がクリアされることを確認
  5. 同様に CVC / カード番号 / 名義人 フィールドでも確認
  6. 戻って Card Form ViewController (Display) でも同じ操作で確認

@koutaku921 koutaku921 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

masterマージのためapproveします。

@koutaku921
koutaku921 merged commit 084a4d8 into payjp:master May 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants