⚠️ Competition Only
This issue was created exclusively for participants of SourceSprint'26, an open-source competition held at VIT Vellore.
Pull requests submitted for this issue will only be accepted from registered SourceSprint'26 participants. Pull requests from others will be closed without review.
Description
When adding or editing a snippet in the modal window, users naturally want to press Ctrl + S (or Cmd + S) to save the work. Right now, doing this triggers the browser's default "Save Page As" dialog. We need to intercept this shortcut to save the snippet instead, but only when the modal is open.
Expected Behavior
- When the snippet modal is open, pressing Ctrl + S or Cmd + S should trigger the saveSnippet() function.
- The browser's default "Save HTML Page" prompt must be strictly blocked.
- If the modal is not open, Ctrl + S should be ignored by our script, allowing the standard browser behavior.
- If the required fields (Title, Category, Code) are empty when the shortcut is pressed, the native form validation should still trigger, exactly as it does when clicking the "Save Snippet" button.
This issue was created exclusively for participants of SourceSprint'26, an open-source competition held at VIT Vellore.
Pull requests submitted for this issue will only be accepted from registered SourceSprint'26 participants. Pull requests from others will be closed without review.
Description
When adding or editing a snippet in the modal window, users naturally want to press Ctrl + S (or Cmd + S) to save the work. Right now, doing this triggers the browser's default "Save Page As" dialog. We need to intercept this shortcut to save the snippet instead, but only when the modal is open.
Expected Behavior