Feedback message captures focus

We recently upgraded our Outsystems platform. Now we have the behavior that an input element looses the focus when a feedback message appears. This is a traditional web app.

Originally we use the input_SetFocus web block from RichWidgets. 

I changed the flow to use the SetFocus action from OutsystemsUIWeb (of course after the Feedback_Message action) but that doesn't set the focus back to the element.

Is this change in behavior intended ? How do I set the focus back to the input element? Or how can I prevent that the feedback message gets the focus?

Hi Joris,


Your base template is from OutsystemsUIWeb (if you upgrated your platform from 10 to 11)? Or are you using other one? Did you already debug your code?

If you inspect in the browser devTools did you have some kind of error?


Best regards,

Ricardo M Pereira

Hi Ricardo,

Thanks for the quick reaction. 

The original issue is from an older application that we migrated to 11, based on the version 10 template (it believe London).

To reproduce it I created the same situation in OutsystemsUIWeb, see https://jjokocha.outsystemscloud.com/DemoFocus/ It is not well documented but I hope you can see the focus leaves the input element after the feedback message appears.

With the console in developer toolset I used document.activeElement to see where the focus was gone.

Kind regards,

Joris Teunissen

Hey Joris,


I recently noticed the same behavior in a new OS 11 web project. The only solution I have been able to come up with so far was to add a class to the input element you want to focus on (like "input_to_focuson"). Then use a runjavascript action that calls the focus method on that element via jquery after your feebackmessage action. 

For example, "$("".input_to_focuson"").focus()".

Though, with the feedback message there is a delay, so we still have to wrap that in a setTimeOut method for about 1 second or we lose focus still. Not the most elegant solution, but it suits the needs for out current project. I've attached an example. Hopefully this helps.



Solution

Joris Teunissen wrote:

We recently upgraded our Outsystems platform. Now we have the behavior that an input element looses the focus when a feedback message appears. This is a traditional web app.

Originally we use the input_SetFocus web block from RichWidgets. 

I changed the flow to use the SetFocus action from OutsystemsUIWeb (of course after the Feedback_Message action) but that doesn't set the focus back to the element.

Is this change in behavior intended ? How do I set the focus back to the input element? Or how can I prevent that the feedback message gets the focus?

 Hi Joris,

As we need to focus on feedback message for accessibility so that screen reader are able to read the message when they dispalyed so focus is helpful for those to make messages accessible.

please go throught this link.

https://www.outsystems.com/forge/component-versions/4143.


Hope this helps


Thanks

AD

 

Solution