Preview link click protection is not correctly scoped

Created on 13 October 2023, 11 months ago
Updated 17 July 2024, about 2 months ago

Problem/Motivation

The node preview has a protection built in that shows a dialog and prevents navigation when any link in the preview is clicked. Currently, this protection is applied to all links in $(document), which isn't a problem in the normal node preview since it is opened in a new page. The Same Page Preview module β†’ however opens the node preview in an iframe, which causes this link protection to be applied to the previewed page as well as the node edit form.

Steps to reproduce

  1. Install the Same Page Preview module β†’ and enable it on a node type.
  2. Click on any link in the node edit form. The 'leave preview' dialog will open.

Proposed resolution

Scope adding the link protection to links in $(context) instead of in $(document). Without same page preview enabled, $(context) refers to the HTMLDocument. With same page preview enabled, $(context) refers to the element containing the preview, not the whole page.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Node systemΒ  β†’

Last updated 1 minute ago

No maintainer
Created by

πŸ‡§πŸ‡ͺBelgium DieterHolvoet Brussels

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024