Make WordPress Core

Opened 5 years ago

Closed 3 months ago

#52519 closed defect (bug) (invalid)

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

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

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
5 years ago

  • Component changed from General to Posts, Post Types

#2 @SirLouen
3 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

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.