-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(ui) submit edit dialogs on enter #3244
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
Conversation
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.
Pull Request Overview
This PR adds the ability to submit edit dialogs by pressing the Enter key, in addition to the existing Escape key functionality for closing dialogs.
- Renamed the keyboard event handler from
handleEscape
tohandleControlKeys
to reflect its expanded functionality - Added Enter key handling to trigger the save action by setting
needSave = true
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
if (ev.key === 'Enter' && this.dialog !== false) { | ||
this.needSave = true; |
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.
The Enter key handler should prevent the default behavior to avoid potential form submission conflicts. Add ev.preventDefault()
after setting needSave = true
.
if (ev.key === 'Enter' && this.dialog !== false) { | |
this.needSave = true; | |
this.needSave = true; | |
ev.preventDefault(); |
Copilot uses AI. Check for mistakes.
if (ev.key === 'Enter' && this.dialog !== false) { | ||
this.needSave = true; | ||
} |
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.
[nitpick] Consider adding a check similar to the Escape handler to ensure Enter doesn't trigger in inappropriate contexts. You may want to add conditions like !this.noEnter
or validate that input fields are focused to prevent accidental saves.
Copilot uses AI. Check for mistakes.
@apollo13 Some dialogs have multiline text inputs, so I don't think this behavior works well for all dialogs. |
Good point, will check. But even then we should find a way to not reload the page on enter like it currently does (not exactly sure though why, I am not really a frontend JavaScript person)
…On Sat, Aug 30, 2025, at 18:09, Denis Gukov wrote:
*fiftin* left a comment (semaphoreui/semaphore#3244)
<#3244 (comment)>
@apollo13 <https://github.com/apollo13> Some dialogs have multiline
text inputs, so I don't think this behavior works well for all dialogs.
—
Reply to this email directly, view it on GitHub
<#3244 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAT5C6OVGKGOME4S72EQE33QHEC5AVCNFSM6AAAAACFA42F76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMZZGM3TCMRYGM>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I don't really know vue so I am not sure this is correct :)