Support Article
Set focus action is not working in IE 11
SA-34838
Summary
There are a couple of actions on click of a text input.
First action is Launch Local action.
Second action is Set Focus action(set focus target is the same element on which actions are triggered)
In the first action after Overlay is launched and if there is any text input or Grid in the section then the focus is going to the grid, or text input but the expected behavior is second action should be triggered and focus should be set on the parent element from which actions are being triggered.
The use case is working fine in Chrome browser but the issue is only in Internet Explorer.
Error Messages
Not Applicable
Steps to Reproduce
- Create an Input box.
- Configure the events as below :
On click event - set value, launch local action, bring the focus back to input box.
Root Cause
Internet Explorer is taking a little more time to render the UI than Chrome, resulting in firing the setItemFocus action first and then focusFirstItem method to focus the first focusable element inside the modal/overlay (As per design).
Resolution
Override the setItemFocus function in UserWorkForm.
The last part of setItemFocus is modified as below:
setTimeout(function(){
targetElem.focus();
if (targetElem.type == "textarea")
pega.u.d.setCursorAtEndofText(targetElem);
else if (targetElem.select && targetElem.select != undefined) {
targetElem.select();
}
},300);
Published March 23, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.