setBusy doesn't block user input until busyIndicatorDelay expires
OpenUI5 version: latest
Browser/version (+device/version): all
Any other tested browsers/devices(OK/FAIL):
URL (minimal example if possible): http://jsbin.com/gekod/edit?html,js,output
User/password (if required and possible - do not post any confidential information here):
Steps to reproduce the problem:
- Enter text in the Input field
- Click the "Save" button
- Quickly click inside the Input field and type more characters until the busyIndicatorDelay expires and finally disables the Input field
What is the expected result? There should be something to block user input during the timeout, and the mouse cursor should change to a busy cursor (if possible). This will prevent the user from changing the view state of the control (and potentially launching callbacks).
What happens instead? When setBusy(true) is called on a control, the method blocks the corresponding control and puts an animation over it after a given delay. The problem is that immediately after the call to setBusy(), the user still has full access to the control until the timeout expires. This is particularly problematic for things such as a Submit/Save button where you do not want the user to press it repeatedly during processing.
Any other information? (attach screenshot if possible)
Hello, Thanks for pointing this out to us. We are taking this as a feature request and will keep you posted!
Best regards, Christiane
Just thinking - until we find a solution for this on our side, maybe you could just disable the button "manually" when you want to prevent it from being clicked twice in a row. Hope this helps! Christiane
Thanks Christiane. We could do that, but it's not very practical since we have a number of applications where this would need to be done, with each having a number of places where it happens, along with various controls that would need to be disabled. It would be much more helpful if this was addressed at the SDK level, but I appreciate the suggestion.
Hi @cmastrandrea ,
Sorry for the delay. Let me know if you're still interested to implement this feature and I'll contact the control owners and will create internal ticket.
Thanks and Kind Regards, Diana, openui5 dispatcher
Thanks Diana. Yes we would still be interested in getting this implemented as currently it allows the user to interact with components after setBusy is called.
Internally tracked: 1780089706
Is there a reason why the default delay between calling set busy and actually disabling the control is set at 1000ms? I assume there must be some implementation detail that makes it impractical to disable immediately, but I don't see any notes in the code indicating what that reason is.
Not sure about the control-level BusyIndicator, but for the full-screen one this delay was added to prevent brief flickering of the entire screen when there are multiple very short busy phases. While some long calculations may take seconds and justify a full-screen display of progress and blocking, many smaller requests might just come back after 100 or 200 ms and showing busy indicators for these short periods of time would look very disturbing. After a second, however, chances are that it will take another second.
An obvious solution might be to have two phases of the busy indicators: first, blocking occurs, with no visual indication (apart maybe of the mouse pointer to somewhat indicate why the user cannot click anything). And after a delay it switches to visible blocking.
That explanation makes sense to me. Is this something that you expect to work on in a forthcoming release, or should we expect to prepare a proposed fix and submit it? Thanks again for the timely response.
Well, the responsible team has this issue report on their list now, but I don't know (nor can I influence) when they will get to this. So they'd need to respond and decide...
Hi @cmastrandrea,
It looks like the solution has finally been implemented.
Best regards Benedikt
Thanks Benedikt. Is this in an existing release or will it be available in the next one?
I stumbled across this problem as well. Looking at the JS Bin example, this issue has not been fixed or reappeared.
My expectation of how the busy state would work: Setting a View/Control to busy immediately prevents any further user interaction.The visual indication that the view/control is busy will only be shown after a delay defined by busyIndicatorDelay.
@bendkt: Can you point to a commit that implemented the solution?
Include busyIndicatorDelay=0 in the definition of the container which busy property will be used.- Default is 1000ms Details: https://sapui5nightly.int.sap.hana.ondemand.com/#/api/sap.ui.core.Control Example: https://jsbin.com/kizuxeboba/edit?html,js,output
Thank you for suggesting a workaround. Does your suggestion imply that the solution proposed by @akudev was not implemented (avoid flickering by separating disabling of UI and showing an actual busy indicator)?
An obvious solution might be to have two phases of the busy indicators: first, blocking occurs, with no visual indication (apart maybe of the mouse pointer to somewhat indicate why the user cannot click anything). And after a delay it switches to visible blocking.