Issue
By default, when users view a record through the Service Portal's ticket page, the ticket conversation widget will submit comments when a user presses enter. The following instructions will allow admins to configure the widget so that pressing enter will trigger a new line break rather than submitting the comment.
Release
All
Resolution
- Log into your instance as an admin
- Find the out of box Service Portal widget "Ticket Conversations"
- Clone the widget
- In the newly cloned widget, go to the Client Controller section
- Find line 416:
if (event.keyCode === 13 && !event.shiftKey) {
6. Edit the line to:
if (!event.keyCode && !event.shiftKey) {
7. Save the widget
8. Replace the "Ticket Conversations" with the newly cloned and edited widget.
Related Links
With the modification above, it isn't possible to enter any characters into the comments field in Firefox.
Please note that Firefox returns 0 for any alphanumeric characters. Therefore, the code doesn't go into the if check and doesn't get run.
The modification works fine in Chrome and IE
NOTE: Further to this, customisations made to the out-of-box product are not covered by the support so you will need to ensure compatibility with future ServiceNow releases and patches.