From 37f7ccc1f22e1d6f75fe27fbfd58f268c09cfac4 Mon Sep 17 00:00:00 2001 From: roykho Date: Thu, 4 Feb 2021 08:08:25 -0800 Subject: [PATCH] Update deprecated jQuery functions for api-keys.js --- assets/js/admin/api-keys.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/admin/api-keys.js b/assets/js/admin/api-keys.js index f51a2cf7e0d..5c22ef3640e 100644 --- a/assets/js/admin/api-keys.js +++ b/assets/js/admin/api-keys.js @@ -53,7 +53,7 @@ .on( 'click', css_class, function( evt ) { evt.preventDefault(); if ( ! document.queryCommandSupported( 'copy' ) ) { - $( css_class ).parent().find( 'input' ).focus().select(); + $( css_class ).parent().find( 'input' ).trigger( 'focus' ).trigger( 'select' ); $( '#copy-error' ).text( woocommerce_admin_api_keys.clipboard_failed ); } else { $( '#copy-error' ).text( '' ); @@ -69,10 +69,10 @@ 'fadeIn': 50, 'fadeOut': 50, 'delay': 0 - } ).focus(); + } ).trigger( 'focus' ); } ) .on( 'aftercopyerror', css_class, function() { - $( css_class ).parent().find( 'input' ).focus().select(); + $( css_class ).parent().find( 'input' ).trigger( 'focus' ).trigger( 'select' ); $( '#copy-error' ).text( woocommerce_admin_api_keys.clipboard_failed ); } ); },