Make WordPress Core

Opened 4 weeks ago

Last modified 22 hours ago

#64623 accepted defect (bug)

Prevent losing data when clicking links on Settings pages

Reported by: sabernhardt's profile sabernhardt Owned by: joedolson's profile joedolson
Milestone: 7.1 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch changes-requested
Focuses: accessibility, javascript Cc:

Description

Reported by @vidugupta on #23432 and PR 9130

Several external links within WordPress admin setting pages—specifically General, Discussion, and Permalink—currently open in the same window. This behavior can negatively impact the user experience in the following ways:

  • Users may lose unsaved changes if they click an external link without first saving their settings.
  • Users may assume the link opens in a new tab (as is the case with links in the Edit Profile page or the Help tab), and unintentionally navigate away from the page.

Inconsistencies in link behavior across admin pages create confusion and a fragmented user experience.

Change History (9)

#1 @sabernhardt
4 weeks ago

#40493 added a JS confirmation before navigating away from the profile page, and that could be appropriate for Settings pages too.

#2 @joedolson
4 weeks ago

  • Milestone changed from Awaiting Review to 7.0
  • Owner set to joedolson
  • Status changed from new to accepted

#3 @westonruter
4 weeks ago

Aside: if bfcache were enabled in the admin, then navigating away from an unsaved settings screen would not mean the loss of unsaved settings. See #63636. That said, browsers typically persist changes to plain form fields when navigating away and back again. Controls built with JS, however, get re-built and there is data loss.

#4 @joedolson
4 weeks ago

I think that it's important to give users a confirmation. Even if those unsaved settings were persistent, the notice ensures that the user is either deciding not to save their changes or reminding them to save their changes. When it's a silent behavior, the user can think that they've already saved and never come back.

Last edited 4 weeks ago by joedolson (previous) (diff)

This ticket was mentioned in PR #10927 on WordPress/wordpress-develop by @anukasha.


4 weeks ago
#5

  • Keywords has-patch added

Trac ticket: [](https://core.trac.wordpress.org/ticket/64623)

## Use of AI Tools

@westonruter commented on PR #10940:


4 weeks ago
#7

Thank you for the PR, but this isn't the right approach. The alert needs to only be shown when there are unsaved changes, and it needs to show when navigating away from an admin screen by any means (including the use of the back button). Please offer suggestions to the existing PR: https://github.com/WordPress/wordpress-develop/pull/10927

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


2 weeks ago

#9 @sabernhardt
22 hours ago

  • Keywords changes-requested added
  • Milestone changed from 7.0 to 7.1

The patch (PR 10927) still needs changes, so I will move this ticket to the next release cycle.

Note: See TracTickets for help on using tickets.