From 7287894f1ac2aa25796008f1e39053969690c22f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 22 May 2023 18:23:19 +0200 Subject: [PATCH] Deprecated: Define `.hover()` using non-deprecated methods Make the deprecated `.hover()` method not rely on other deprecated methods: `.mouseenter()` & `.mouseleave()`. Use `.on()` instead. Closes gh-5251 (cherry picked from commit fd6ffc5eb2c12562f2656d2f33865448420252be) --- src/deprecated/event.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/deprecated/event.js b/src/deprecated/event.js index d46a3b87c..4c6e60c10 100644 --- a/src/deprecated/event.js +++ b/src/deprecated/event.js @@ -28,7 +28,9 @@ jQuery.fn.extend( { }, hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + return this + .on( "mouseenter", fnOver ) + .on( "mouseleave", fnOut || fnOver ); } } ); -- 2.39.5