Help/About: Fix closing contextual help when scrolled.

Change from `scrollIntoView` to `scrollIntoViewIfNeeded` so scrolling will only fire when it is required. `scrollIntoViewIfNeeded` is a proprietary method that is not standardized and not currently on a track towards standards. However, testing has it working well, including in Firefox, which supposedly does not support it.

Props mikecho, studionashvegas, mai21, piotrek, Heiko_Mamerow, costdev, joedolson.
Fixes #55342.
Built from https://develop.svn.wordpress.org/trunk@56243


git-svn-id: http://core.svn.wordpress.org/trunk@55755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson 2023-07-16 16:45:22 +00:00
parent 7a703a1b0f
commit aa7c98232f
3 changed files with 4 additions and 4 deletions

View File

@ -1407,8 +1407,8 @@ $( function() {
* @return {void}
*/
$('#contextual-help-link, #show-settings-link').on( 'focus.scroll-into-view', function(e){
if ( e.target.scrollIntoView )
e.target.scrollIntoView(false);
if ( e.target.scrollIntoViewIfNeeded )
e.target.scrollIntoViewIfNeeded(false);
});
/**

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.3-beta4-56242';
$wp_version = '6.3-beta4-56243';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.