Make WordPress Core

Opened 6 years ago

Closed 12 months ago

#52519 closed defect (bug) (invalid)

Anchor links not working on password-protected pages (on first click)

Reported by: chrslcy Owned by:
Priority: normal Milestone:
Component: Posts, Post Types Version: 5.6.1
Severity: normal Keywords:
Cc: Focuses:

Description

When first clicking an anchor link, the target of which is a password-protected page, and entering the password, the page is loaded without the #anchor in the URL and without jumping to the anchor content. The person has to go back and click the link again after entering the password to jump to the anchor on the page.

Change History (2)

#1 @SergeyBiryukov
6 years ago

  • Component GeneralPosts, Post Types

#2 @SirLouen
12 months ago

  • Milestone Awaiting Review
  • Resolutioninvalid
  • Status newclosed

This is expected. The HTML content, where the anchor is, is locked and not displayed yet on the DOM. Once you "unlock it" via password, you get a cookie, that lets you enter the page without having to input the password more for a couple of days. During this time, the DOM is unlocked, hence the anchor is visible and this is why, when you go back and forth, or if you refresh the page, the page navigates to the anchor position.

So in conclusion, this behavior is exactly working as expected.

Note: See TracTickets for help on using tickets.