WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#32055 closed defect (bug) (fixed)

Filesystem Credentials Request Modal: Inline JavaScript focuses every first input of a form

Reported by: ocean90 Owned by: ocean90
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.2
Component: Filesystem API Keywords: has-patch commit
Focuses: ui Cc:

Description

Originally reported by sergej.mueller:

When wp_print_request_filesystem_credentials_modal() is called and credentials are required request_filesystem_credentials() is printed. That includes some inline JavaScript:

<script type="text/javascript">
<!--
jQuery(function($){
	jQuery("#ssh").click(function () {
		jQuery("#ssh_keys").show();
	});
	jQuery("#ftp, #ftps").click(function () {
		jQuery("#ssh_keys").hide();
	});
	jQuery('form input[value=""]:first').focus();
});
-->
</script>

The last line will focus every first input of a form. On wp-admin/plugins.php this will be the search input.

Attachments (2)

32055.diff (445 bytes) - added by valendesigns 6 years ago.
32055.1.diff (445 bytes) - added by valendesigns 6 years ago.
CSS id instead of class.

Download all attachments as: .zip

Change History (7)

@valendesigns
6 years ago

#1 @valendesigns
6 years ago

  • Keywords has-patch added; needs-patch removed

We could target the form pretty easily and fix this. Uploaded a quick patch.

@valendesigns
6 years ago

CSS id instead of class.

This ticket was mentioned in Slack in #core by drew. View the logs.


6 years ago

#3 @DrewAPicture
6 years ago

Tested 32055.1.diff on wp-admin/plugins.php and wp-admin/network/plugins.php and the search field is no longer focused. On the FS credentials modal, the first field is still focused on launch as expected.

@ocean90: are there any other screens we should be testing?

#4 @DrewAPicture
6 years ago

  • Keywords commit added

#5 @ocean90
6 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 32266:

Don't focus input fields outside of the request filesystem credentials form.

props valendesigns.
fixes #32055.

Note: See TracTickets for help on using tickets.