Input widget inside pop-up not working

Hi, when entering a value into an input widget (which is present in a Pop-up) the values can't be entered properly.


By selecting the input widget we enter the values (for Ex: 4567), but i had to select the i/p widget each and every time i enter a single digit, after entering a digit it automatically gets out of the widget and I had to select the widget once again.


can anyone please help me finding the solution

captured.gif

mvp_badge
MVP

Hi VIVEKANANDAN,

Refer to the below-mentioned post Links: 

https://www.outsystems.com/forums/discussion/68984/widget-popup-focus/#Post277127

https://www.outsystems.com/forums/discussion/54585/setting-focus-to-an-input-on-reactive-app/ 


PS: Problem with the mentioned approach is that, you will have to do the same implementaion for all the input field/widgets defined within the popup.


Hope this helps you!


Kind regards,

Benjith Sam

Hi,

That's due to some problems with the React rendering, use this solution:

  1. Define an OnChange handler to the respective Input widget
  2. Introduce a JS node (with an input parameter i.e. InputWidgetId) in the handler client action flow
  3. Define the below-mentioned JavaScript in the JS node

JavaScript Snippet:

setTimeout(function() {
    
    var elementId = document.getElementById($parameters.TextAreaWidgetId);
    
    if(elementId) {
        elementId.focus();
    }      
    
}, 1);

Hope it helps,

Ricardo Pisco.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.