Forum Stats

  • 3,733,845 Users
  • 2,246,829 Discussions
  • 7,856,892 Comments

Discussions

[JET v10] oj-input-text valueChanged does not trigger on Offcanvas autodismiss

Philip Sommer
Philip Sommer Member Posts: 77 Red Ribbon

Hi Community,


I have the following issue under Firefox 88.0.1 (64 bit):

When positioning a oj-text-input control on an offcanvas and auto-dismissing it (i.e. clicking the main content), the on-value-changed listener does not fire and the corresponding observable is not updated.


How to reproduce

You can reproduce with the Offcanvas Demo at https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=offcanvas&demo=basic by making the following changes:

Add 'ojs/ojinputtext' as a dependency to demo.js and add to the model constructor:

this.testValue = ko.observable('');
this.testValueChanged = console.log;

Add a oj-input-text to any of the drawers:

<oj-input-text id="testInput" value="{{testValue}}"  on-value-changed="[[testValueChanged]]">

Test by opeing the drawer and editing the input-text. Then either tab out of it (=> obervable will update and console logs the event) or click outside the drawer (=> no update/log).


The same bahviour can NOT be reproduced in Brave Browser Version 1.24.86 (Chromium: 90.0.4430.212) (64-Bit).


Workaround

I could not find a workaround so far. Calling valueHasMutated() on the bound observable has no effect.


I'm thankful for any tips.


Kind Regards,

Philip

Answers

  • John 'JB' Brock-Oracle
    John 'JB' Brock-Oracle Posts: 2,546 Employee

    This is by design and expected. The only thing that will trigger the valueChanged event is if you tab out of the component or press enter. Simply clicking away will not trigger the change. If I remember correctly, the reason for the explicit action being required is for Accessibility reasons.

    --jb

  • Philip Sommer
    Philip Sommer Member Posts: 77 Red Ribbon

    Hi John,


    Thank you for the explanation. However, I would expect the value to be updated on focus loss (of the control) as well. Otherwise one could make changes to the UI without them getting reflected in the knockout binding.

    I find that in practice, this is pretty much how it works and clicking away does trigger the value change basically everywhere. E.g. Chrome does not have the described problem at all and Firefox only does this when clicking to dismiss the offcanvas. If I click inside the offcanvas (and outside the input) the value is also changed. I also note, that on Firefoyx the cursor is still in the input-text field and I can continue typing, even if I entered a different input-text in the main content.


    In any case, would there possibly be a workaround for this?


    Kind Regards,

    Philip

Sign In or Register to comment.