mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Make "cancel" buttons have proper type in modal forms (#25618)
Replace #25446, fix #25438 All "cancel" buttons which do not have "type" should not submit the form, should not be triggered by "Enter". This is a complete fix for all modal dialogs. The major change is "modules/aria/modal.js", "devtest" related code is for demo/test purpose.
This commit is contained in:
		| @@ -34,7 +34,7 @@ func List(ctx *context.Context) { | ||||
|  | ||||
| func FetchActionTest(ctx *context.Context) { | ||||
| 	_ = ctx.Req.ParseForm() | ||||
| 	ctx.Flash.Info(ctx.Req.Method + " " + ctx.Req.RequestURI + "<br>" + | ||||
| 	ctx.Flash.Info("fetch-action: " + ctx.Req.Method + " " + ctx.Req.RequestURI + "<br>" + | ||||
| 		"Form: " + ctx.Req.Form.Encode() + "<br>" + | ||||
| 		"PostForm: " + ctx.Req.PostForm.Encode(), | ||||
| 	) | ||||
| @@ -52,5 +52,15 @@ func Tmpl(ctx *context.Context) { | ||||
| 	ctx.Data["TimePast1y"] = now.Add(-1 * 366 * 86400 * time.Second) | ||||
| 	ctx.Data["TimeFuture1y"] = now.Add(1 * 366 * 86400 * time.Second) | ||||
|  | ||||
| 	if ctx.Req.Method == "POST" { | ||||
| 		_ = ctx.Req.ParseForm() | ||||
| 		ctx.Flash.Info("form: "+ctx.Req.Method+" "+ctx.Req.RequestURI+"<br>"+ | ||||
| 			"Form: "+ctx.Req.Form.Encode()+"<br>"+ | ||||
| 			"PostForm: "+ctx.Req.PostForm.Encode(), | ||||
| 			true, | ||||
| 		) | ||||
| 		time.Sleep(2 * time.Second) | ||||
| 	} | ||||
|  | ||||
| 	ctx.HTML(http.StatusOK, base.TplName("devtest"+path.Clean("/"+ctx.Params("sub")))) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user