diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 48fa9923e4..1cbdccdb09 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -37,6 +37,7 @@ Changelog * Maintenance: Remove defunct oEmbed providers (Rahul Samant) * Maintenance: Remove obsolete non-upsert-based code for Postgres search indexing (Jake Howard) * Maintenance: Remove unused Rangy JS library (LB (Ben) Johnston) + * Maintenance: Update `PreviewController` usage to leverage Stimulus actions instead of calling `preventDefault` manually (Ayaan Qadri) 6.3 LTS (01.11.2024) diff --git a/client/src/controllers/PreviewController.test.js b/client/src/controllers/PreviewController.test.js index d1e7612438..66b9e55986 100644 --- a/client/src/controllers/PreviewController.test.js +++ b/client/src/controllers/PreviewController.test.js @@ -163,7 +163,7 @@ describe('PreviewController', () => { Preview in new tab diff --git a/client/src/controllers/PreviewController.ts b/client/src/controllers/PreviewController.ts index 2cfe662b31..ab55361dd8 100644 --- a/client/src/controllers/PreviewController.ts +++ b/client/src/controllers/PreviewController.ts @@ -803,7 +803,6 @@ export class PreviewController extends Controller { * @returns whether the data is valid */ async openPreviewInNewTab(event: MouseEvent) { - event.preventDefault(); const link = event.currentTarget as HTMLAnchorElement; const valid = await this.setPreviewDataWithAlert(); diff --git a/docs/releases/6.4.md b/docs/releases/6.4.md index 5f4a24c6e1..97cd0d1b56 100644 --- a/docs/releases/6.4.md +++ b/docs/releases/6.4.md @@ -57,6 +57,7 @@ depth: 1 * Remove defunct oEmbed providers (Rahul Samant) * Remove obsolete non-upsert-based code for Postgres search indexing (Jake Howard) * Remove unused Rangy JS library (LB (Ben) Johnston) + * Update `PreviewController` usage to leverage Stimulus actions instead of calling `preventDefault` manually (Ayaan Qadri) ## Upgrade considerations - changes affecting all projects diff --git a/wagtail/admin/templates/wagtailadmin/shared/side_panels/preview.html b/wagtail/admin/templates/wagtailadmin/shared/side_panels/preview.html index c829d8d7a5..ab1e187b2f 100644 --- a/wagtail/admin/templates/wagtailadmin/shared/side_panels/preview.html +++ b/wagtail/admin/templates/wagtailadmin/shared/side_panels/preview.html @@ -33,7 +33,7 @@ {% endblock %} {% block new_tab_button %} - {% icon name="link-external" %} + {% icon name="link-external" %} {% endblock %}