-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove jQuery from the "quick submit" handler #29200
Conversation
- Switched to plain JavaScript - Tested the quick submit functionality and it works as before Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Hope you tested it 😆 |
@@ -8,7 +8,7 @@ export function handleGlobalEnterQuickSubmit(target) { | |||
|
|||
// here use the event to trigger the submit event (instead of calling `submit()` method directly) | |||
// otherwise the `areYouSure` handler won't be executed, then there will be an annoying "confirm to leave" dialog | |||
form.dispatchEvent(new SubmitEvent('submit', {bubbles: true, cancelable: true})); | |||
form.dispatchEvent(new SubmitEvent('submit')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but does that also apply to SubmitEvent
? Neither MDN nor the HTML spec seem to give an answer, so we may need to test it. Might also be good to check what jQuery did internally and just do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reverts commit cf8d365.
…o-gitea#29223) Partially related to go-gitea#29200 and fix other potential bugs. Co-authored-by: Giteabot <teabot@gitea.io>
- Switched to plain JavaScript - Tested the quick submit functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/abbd6c49-ad0f-4f95-b4ba-e969b85a46e8) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com>
…o-gitea#29223) Partially related to go-gitea#29200 and fix other potential bugs. Co-authored-by: Giteabot <teabot@gitea.io>
- Switched to plain JavaScript - Tested the quick submit functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/abbd6c49-ad0f-4f95-b4ba-e969b85a46e8) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> (cherry picked from commit d8d4b33)
Automatically locked because of our CONTRIBUTING guidelines |
Demo using JavaScript without jQuery