Skip to content

Commit a32614c

Browse files
authored
remove aria-busy from root node when target _none (#140)
1 parent 10abaee commit a32614c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ async function send(control, action = '', method = 'GET', body = null, enctype =
402402
let renders = PendingTargets.get(response).map(async target => {
403403

404404
if (!target.isConnected || target._ajax_id === '_none') {
405+
PendingTargets.delete(target)
405406
return
406407
}
407408

tests/load.cy.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,19 @@ test('aria-busy is removed from targets that are not replaced',
107107
})
108108
}
109109
)
110+
111+
test('aria-busy is removed from root node when target is _none',
112+
html`<html><a href="/tests" x-target="_none">Link</a></html>`,
113+
({ intercept, get, wait }) => {
114+
intercept('GET', '/tests', {
115+
delay: 1000,
116+
statusCode: 200,
117+
body: '',
118+
}).as('response')
119+
get('a').click()
120+
get('html').should('have.attr', 'aria-busy')
121+
wait('@response').then(() => {
122+
get('html').should('not.have.attr', 'aria-busy')
123+
})
124+
}
125+
)

0 commit comments

Comments
 (0)