Znuny/Znuny LTS is a fork of the ((OTRS)) Community Edition, one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management.
On a page with both Save as new draft and Submit buttons, pressing the Enter key inside a element triggers the Save as new draft button by default.
In order to fix this behaviour, the following code could be added to Core.Form.js.
$('body').on('keydown', 'input', function (Event) {
if (Event.keyCode == 13 && $(this).closest('form').find(':submit').length > 0) {
Event.preventDefault();
$(this.form).find(':submit').last().click();
}
});
Additionally, the code that handles the user attempting to submit a form from within a
$('body').on('keydown', 'textarea', function (Event) {
if ((Event.ctrlKey || Event.metaKey) && Event.keyCode == 13) {
// We need to click() instead of submit(), since click() has
// a few useful event handlers tied to it, like validation.
Event.preventDefault();
$(this.form).find(':submit').last().click();
}
});
Type of change
1 - 🐞 bug 🐞
Additional information
Navigate to AgentTicketZoom
Click on Communication and select Note
Enter some dummy information in both Subject and Text, click inside of Subject and click Enter
You will be presented with the Add new draft popup instead of the form submitting
Checklist
[x] The code change is tested and works locally.(❗)
[x] There is no commented out code in this PR.(❕)
[ ] You improved or added new unit tests.(❕)
[ ] Local ZnunyCodePolicy passed.(❕)
[ ] Local UnitTests / Selenium passed.(❕)
[ ] GitHub workflow CI (UnitTests / Selenium) passed.(❗)
Proposed change
On a page with both Save as new draft and Submit buttons, pressing the Enter key inside a element triggers the Save as new draft button by default.
In order to fix this behaviour, the following code could be added to Core.Form.js.
Additionally, the code that handles the user attempting to submit a form from within a
Type of change
1 - 🐞 bug 🐞
Additional information
Checklist