File tree Expand file tree Collapse file tree 2 files changed +40
-4
lines changed
Expand file tree Collapse file tree 2 files changed +40
-4
lines changed Original file line number Diff line number Diff line change @@ -219,10 +219,7 @@ document.addEventListener("submit", async (e) => {
219219 const lowerMethod =
220220 e . submitter ?. getAttribute ( "formmethod" ) ?. toLowerCase ( ) ??
221221 el . method . toLowerCase ( ) ;
222- if (
223- lowerMethod !== "get" && lowerMethod !== "post" &&
224- lowerMethod !== "dialog"
225- ) {
222+ if ( lowerMethod !== "get" && lowerMethod !== "post" ) {
226223 return ;
227224 }
228225
Original file line number Diff line number Diff line change @@ -1833,6 +1833,45 @@ Deno.test({
18331833 } ,
18341834} ) ;
18351835
1836+ Deno . test ( {
1837+ name : "partials - submit form dialog should do nothing" ,
1838+ fn : async ( ) => {
1839+ const app = testApp ( )
1840+ . post ( "/partial" , ( ) => {
1841+ throw new Error ( "FAIL" ) ;
1842+ } )
1843+ . get ( "/" , ( ctx ) => {
1844+ return ctx . render (
1845+ < Doc >
1846+ < div f-client-nav >
1847+ < dialog open >
1848+ < p > Greetings, one and all!</ p >
1849+ < form method = "dialog" >
1850+ < Partial name = "foo" >
1851+ < p class = "init" > init</ p >
1852+ </ Partial >
1853+ < SelfCounter />
1854+ < button type = "submit" class = "update" > OK</ button >
1855+ </ form >
1856+ </ dialog >
1857+ </ div >
1858+ </ Doc > ,
1859+ ) ;
1860+ } ) ;
1861+
1862+ await withBrowserApp ( app , async ( page , address ) => {
1863+ await page . goto ( address , { waitUntil : "load" } ) ;
1864+ await page . locator ( ".ready" ) . wait ( ) ;
1865+
1866+ await page . locator ( ".increment" ) . click ( ) ;
1867+ await waitForText ( page , ".output" , "1" ) ;
1868+
1869+ await page . locator ( ".update" ) . click ( ) ;
1870+ await page . locator ( "dialog:not([open])" ) . wait ( ) ;
1871+ } ) ;
1872+ } ,
1873+ } ) ;
1874+
18361875Deno . test ( {
18371876 name : "partials - submit form redirect" ,
18381877 fn : async ( ) => {
You can’t perform that action at this time.
0 commit comments