• Resolved janez33

    (@janez33)


    Problem description:

    On iOS Safari/Chrome [Apple devices such as iPhone], the Braintree WooCommerce credit card form won’t let you refocus the Expiration Date field after you’ve moved to the CVV. When you tap the Expiration Date again, focus instantly jumps back to CVV, so you can’t enter or correct the date.

    iPhone :x: (issue occurs)
    Android :white_check_mark: (works correctly)
    Desktop (Mac / Windows) :white_check_mark: (works correctly)

    Video recording of the problem:
    https://drive.google.com/file/d/1hHXKboLQAHn52SdiODfsG5ERPuxR3GZU/view?usp=sharing

    Steps to reproduce:

    1. Open checkout on an iPhone
    2. Start entering card details
    3. Focus correctly moves to the expiration date field
    4. User enters the expiration date
    5. User moves focus to the CVV field
    6. User attempts to return to the expiration date field
    7. Focus cannot be placed back on the expiration date field; it always jumps to CVV

    Additional observations:

    1. The expiration date field works only the first time
    2. The issue appears after the field loses focus
    3. This behavior is consistent across multiple shops and configurations
    4. We tested different plugin versions with the same result
    5. This seems related to iOS WebKit focus handling in iframes / Hosted Fields
    • This topic was modified 9 months, 2 weeks ago by janez33.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 16 through 25 (of 25 total)
  • Thread Starter janez33

    (@janez33)

    Hello
    yesterday new version of the plugin was released, as I was reading through changelog I haven’t seen this issue to be fixed. Can you please confirm this will be fixed in the new upcoming version?
    Thank you very much

    Hi there!

    I can understand your concern. Currently, we do not have an ETA for when the issue will be fixed. I have escalated this issue again, and once we receive any updates regarding the fix, we will inform you. Thank you for your cooperation.

    Thread Starter janez33

    (@janez33)

    I don’t think you realize but this issue is preventing iOS users from finishing the order, thank you very much for escalating this but it should be on a high priority as it is a blocking checkout issue.

    Hi @janez33,

    I can see how impactful this issue is, especially since it’s affecting checkout completion for iOS users, and I completely understand the urgency here.

    Please rest assured that we are actively following up on this with our internal team and keeping close track of progress. As soon as we receive any updates or have more information to share, we will get back to you right away.

    We truly appreciate your patience while this is being worked on, and we’ll keep you informed every step of the way.

    Thread Starter janez33

    (@janez33)

    Hello, is this going to be fixed anytime soon?

    Plugin Support Shameem – a11n

    (@shameemreza)

    Hi @janez33

    Seven months on this deserves a straight answer.

    There’s no plugin fix coming for this one. The card fields at checkout are Braintree Hosted Fields, iframes served by Braintree’s own SDK, so the plugin has no control over focus behavior inside them. Our team reproduced the same focus issue on PayPal’s official Hosted Fields demo page on iOS, with no WordPress or plugin involved, which confirms the bug lives in Braintree’s SDK. Only PayPal can fix it there.

    One thing that can genuinely move it: report this to Braintree support directly from your merchant account. Reports from merchants carry more weight with PayPal than anything else, and you can point them at their own demo to show it happening with no plugin in the picture: https://developer.paypal.com/braintree/docs/guides/hosted-fields/examples/javascript/v3/

    I know that’s not the update you were hoping for, but it’s the accurate one.

    Thread Starter janez33

    (@janez33)

    Hello,

    I’m back with official Braintree Support answer:

    Our SDK team noted that they added a workaround in the Web SDK version 3.128.0. You can add the “preventCursorJumps: true” option to your hosted fields configuration which should help mitigate the issue.

    is this something you can add to fix this issue in your plugin?

    Have a nice day,

    Janez

    Plugin Support Shameem – a11n

    (@shameemreza)

    Hi @janez33

    Thanks for taking this to Braintree and coming back with their SDK team’s answer. It changes what I said last time: the plugin can turn this option on itself, so this one may be fixable from our side after all.

    The plugin has loaded Braintree’s Web SDK 3.129.1 since version 3.5.0, so preventCursorJumps is already there if you’re on 3.5.0 or newer. It just isn’t turned on yet.

    Can you please add this snippet on staging.vigoexpress.dk and repeat the steps from your video on an iPhone? You can add it with the Code Snippets plugin or in your child theme’s functions.php file. It turns the option on for both the classic and the block checkout.

    // Provided by Woo Support on 2026-10-18
    // Purpose: Test fix for iOS focus jumping from Expiry date back to CVV in the Braintree card form. Turns on the Braintree SDK's preventCursorJumps option on classic and block checkout.
    // Contact: support@woocommerce.com
    
    add_action( 'wp_enqueue_scripts', function () {
        if ( ! wp_script_is( 'braintree-js-hosted-fields', 'enqueued' ) ) {
            return;
        }
    
        wp_add_inline_script(
            'braintree-js-hosted-fields',
            '(function () {
                var hostedFields = window.braintree && window.braintree.hostedFields;
                if ( ! hostedFields || ! hostedFields.create || hostedFields.create.preventCursorJumpsAdded ) {
                    return;
                }
                var originalCreate = hostedFields.create;
                hostedFields.create = function ( options ) {
                    var args = Array.prototype.slice.call( arguments );
                    args[0] = Object.assign( {}, options, { preventCursorJumps: true } );
                    return originalCreate.apply( this, args );
                };
                hostedFields.create.preventCursorJumpsAdded = true;
            })();',
            'after'
        );
    }, 20 );

    Please note that custom code is outside our support scope, so I’m sharing this one as a test, and we aren’t in a position to:

    • Troubleshoot any conflicts that may arise when using a custom snippet.
    • Further modify the snippet’s behavior.

    If you need further help with customizations, I’d recommend reaching out to Codeable. They’re our official development partner and have vetted WooCommerce specialists.

    On my test site, the option reaches Braintree’s card fields on both checkouts, and a sandbox card payment went through on the classic checkout.

    Once you’ve tested, can you please post here whether the Expiry date field keeps focus when you go back to it from the CVV field? If it does, I’ll share the result with our developers so the option can be added to the plugin itself.

    Thread Starter janez33

    (@janez33)

    I confirm this snippet fixes the problem, so you should go ahead and fix this in your plugin.
    Regards,
    Janez

    Plugin Support Shameem – a11n

    (@shameemreza)

    Hi @janez33 that’s great to hear. Thanks for testing it on your iPhone, and for your patience on this one.

    I’ve reported it to our developers with your result so the option can be added to the plugin itself. I don’t have an ETA at the moment, so you can keep the snippet in place until an update includes it.

    I’ll mark this thread as resolved. If anyone else runs into the same focus jump on iPhone, the snippet above fixes it.

Viewing 10 replies - 16 through 25 (of 25 total)

You must be logged in to reply to this topic.