mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-28 13:31:06 +00:00
regression test for previous fix
move event cancellation before filtering so form submissions can be cancelled properly
This commit is contained in:
parent
fa2fa8017e
commit
c773e86131
@ -98,4 +98,16 @@ describe("Core htmx Regression Tests", function(){
|
||||
byId("d1").innerText.should.equal('Replaced');
|
||||
});
|
||||
|
||||
it('does not submit with a false condition on a form', function() {
|
||||
this.server.respondWith("POST", "/test", "Submitted");
|
||||
var defaultPrevented = false;
|
||||
htmx.on("click", function(evt) {
|
||||
defaultPrevented = evt.defaultPrevented;
|
||||
})
|
||||
var form = make('<form hx-post="/test" hx-trigger="click[false]"></form>');
|
||||
form.click()
|
||||
this.server.respond();
|
||||
defaultPrevented.should.equal(true);
|
||||
})
|
||||
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user