From b0dc6c1ea58659310ee87888200a21f25753b02e Mon Sep 17 00:00:00 2001 From: LB Johnston Date: Thu, 6 Jul 2023 22:04:14 +1000 Subject: [PATCH] Revise the default SwapController target to the more common '#listing-results' --- client/src/controllers/SwapController.test.js | 6 +++--- client/src/controllers/SwapController.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/controllers/SwapController.test.js b/client/src/controllers/SwapController.test.js index 5f263762ac..678d3ae1b9 100644 --- a/client/src/controllers/SwapController.test.js +++ b/client/src/controllers/SwapController.test.js @@ -43,7 +43,7 @@ describe('SwapController', () => { expect(handleError).not.toHaveBeenCalled(); document.body.innerHTML = ` -
+
{ expect(handleError).not.toHaveBeenCalled(); document.body.innerHTML = ` -
+
{ }); }); - describe('fallback on window.headerSearch values if not in HTML', () => { + describe('fallback on window.headerSearch values if not in HTML (RemovedInWagtail60)', () => { it('should set the src & target value from the window.headerSearch if not present', async () => { window.headerSearch = { termInput: '#search', diff --git a/client/src/controllers/SwapController.ts b/client/src/controllers/SwapController.ts index fa3661eed8..eb0f465fb4 100644 --- a/client/src/controllers/SwapController.ts +++ b/client/src/controllers/SwapController.ts @@ -48,7 +48,7 @@ const getGlobalHeaderSearchOptions = (): { * data-controller="w-swap" * data-action="input->w-swap#searchLazy" * data-w-swap-src-value="path/to/search" - * data-w-swap-target-value="#results" + * data-w-swap-target-value="#listing-results" * /> * */ @@ -63,7 +63,7 @@ export class SwapController extends Controller< icon: { default: '', type: String }, loading: { default: false, type: Boolean }, src: { default: '', type: String }, - target: { default: '#results', type: String }, + target: { default: '#listing-results', type: String }, wait: { default: 200, type: Number }, };