- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2020 12:33 AM
Hi guys
I have an SP modal widget which contain textarea element, in this field the user should have the ability to break-line by press enter key, but in this case the modal is closing.
I see that if I use f12 with debugger is behave OK, also if I add any alert dialog in the controller.
I already try to "catch" the ENTER key event and put 'return false' or use the method
preventDefault()
but nothing help, even the HI supporters not have any good idea.
Can you advise any WA for it?
I know this is not ServiceNow pure issue but I hope you could assist with workaround for this.
Tnx
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2020 03:07 AM
Hi
Please try bellow script it works for me. The problem was with the modal default buttons.
spModal.open({
title: 'Hi',
backdrop: 'static',
keyboard: false,
buttons: ['',''];
});
Or, if you want to keep the buttons
spModal.open({
title: 'Hi',
backdrop: 'static',
keyboard: false,
buttons: [
{label:'Ok', hide: true},
{label:'Cancel', hide: true}
];
});
Please mark my ANSWER as CORRECT and HELPFUL if it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2020 04:47 AM
Hello,
I hope the below link gives you fair idea abt the issue
Mark my ANSWER as CORRECT and HELPFUL if it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2020 05:17 AM
Hi
I already reviewed that thread, didn't help.
The modal is closing by ENTER key even if I'm removing all the button elements from it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2020 08:12 AM
In the below link it has been mentioned how to prevent closure of modal , see if this helps in your case you just need to replace submit with enter,
Else , raise a HI ticket on service portal and ask for direction .....
Mark my ANSWER as CORRECT and HELPFUL if it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2020 08:51 AM
Already raise a HI ticket, as I mentioned, they guide me to the community since they don't have any workaround and this is not of the HI support scope.
Regarding the StackOverflow, I think I reviewed all the relevant threads there, nothing helped - so I came here.
This one you mentioned - talk about the 'backdrop' property, this
prevent the modal window from closing when clicking outside the modal window, but my issue while is clicking on ENTER while input / textarea element is on focused.
Maybe the experts could assist?