Notifications

3858 views

Description

Unexpected behavior of the "SC catalog item" widget encountered since Jakarta: While in the "SC Catalog Item" widget, when a user presses the Enter key in an input field, browser attachments dialog opens.

 

Steps to Reproduce

  1. Navigate to https://<instance_name>.service-now.com/sp?id=sc_cat_item&sys_id=38c1fc840a0a0b2700285921c2bf5fc8.
  2. Set focus in any text input field and press Enter.
  3. Notice that this opens the attachment dialog box to select the file

Pressing the Enter key in a variable or field will trigger the last element on the page instead of submit.

Workaround

This issue has been fixed. If you are able to upgrade, review the Fixed In or Intended Fix Version fields to determine whether any versions have a planned or permanent fix.

If you are not able to upgrade yet, one of these workarounds can provide temporary relief:

  1. Place the input fields outside the form tag, this will prevent the form from being submitted on pressing enter.

  2. If the customer is using widget "SC Catalog Item Deprecated", try using the newer version of this widget: "SC Catalog Item": /nav_to.do?uri=sp_widget.do?sys_id=3c29786e87133200e0ef0cf888cb0bdf

  3. Since Jakarta, modify the standard widget "SC Catalog Item" in its Body HTML template code, swapping the order of the lines listed below.
    Replace then all the page occurrences of the standard widget "SC Catalog Item" with the new cloned version of the widget. You can find the page occurrences of this widget in the Included pages section of the "SC Catalog Item" widget.

"SC Catalog Item" swap lines from:

<label ng-if="!submitted" style="float:right;font-weight:normal;cursor:pointer;"><sp-attachment-button></sp-attachment-button><span style="padding-left:4px;">${Add attachments}</span></label>
<button ng-if="::c.showOrderNowButton()" tabindex="0" name="submit" ng-disabled="submitted" ng-click="triggerOnSubmit()" class="btn btn-primary">{{submitButtonMsg}}</button>

to:

<button ng-if="::c.showOrderNowButton()" tabindex="0" name="submit" ng-disabled="submitted" ng-click="triggerOnSubmit()" class="btn btn-primary">{{submitButtonMsg}}</button>
<label ng-if="!submitted" style="float:right;font-weight:normal;cursor:pointer;"><sp-attachment-button></sp-attachment-button><span style="padding-left:4px;">${Add attachments}</span></label>

 


Related Problem: PRB1189578

Seen In

Jakarta Patch 3

Fixed In

Kingston Patch 9
London

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-11-16 09:26:40
Published:2019-11-16