Revise the default SwapController target to the more common '#listing-results'

pull/10689/head
LB Johnston 2023-07-06 22:04:14 +10:00 zatwierdzone przez LB (Ben Johnston)
rodzic 09aee38ca9
commit b0dc6c1ea5
2 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -43,7 +43,7 @@ describe('SwapController', () => {
expect(handleError).not.toHaveBeenCalled();
document.body.innerHTML = `
<div id="results"></div>
<div id="listing-results"></div>
<input
id="search"
type="text"
@ -66,7 +66,7 @@ describe('SwapController', () => {
expect(handleError).not.toHaveBeenCalled();
document.body.innerHTML = `
<div id="results"></div>
<div id="listing-results"></div>
<input
id="search"
type="text"
@ -112,7 +112,7 @@ describe('SwapController', () => {
});
});
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',

Wyświetl plik

@ -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 },
};