summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormanchandavishal <manchandavishal143@gmail.com>2023-05-09 17:20:27 +0530
committermanchandavishal <manchandavishal143@gmail.com>2023-05-09 17:20:27 +0530
commiteafd2f41b77048e51007dc4d5f2a6ebe790fa7b9 (patch)
tree1775bb5fa130990adfdaf19976e9922d465f3b0f
parent852d5dc7922abe0b9d2a3e26ed6ede9902a2da47 (diff)
downloadhorizon-eafd2f41b77048e51007dc4d5f2a6ebe790fa7b9.tar.gz
Fix deprecated use of 'jQuery.fn.focus()' shorthand event
This patch changed the code to use the recommended .trigger("focus") method instead of the deprecated .focus(). For more information about this deprecation, please refer [1]. [1] https://api.jquery.com/focus-shorthand/ Change-Id: Ib743c2d5d01aa81d43b2d38efc01496b25f58b26
-rw-r--r--horizon/static/horizon/js/horizon.modals.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/horizon/static/horizon/js/horizon.modals.js b/horizon/static/horizon/js/horizon.modals.js
index 87e546ca2..cbad7dd1d 100644
--- a/horizon/static/horizon/js/horizon.modals.js
+++ b/horizon/static/horizon/js/horizon.modals.js
@@ -169,7 +169,7 @@ horizon.modals.init_wizard = function () {
});
// Focus the first invalid field.
if (first_field) {
- $field.focus();
+ $field.trigger('focus');
first_field = false;
}
});
@@ -428,7 +428,7 @@ horizon.addInitFunction(horizon.modals.init = function() {
// Focus the first usable form field in the modal for accessibility.
horizon.modals.addModalInitFunction(function (modal) {
- $(modal).find(":text, select, textarea").filter(":visible:first").focus();
+ $(modal).find(":text, select, textarea").filter(":visible:first").trigger("focus");
});
horizon.modals.addModalInitFunction(function(modal) {