openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

setBusy doesn't block user input until busyIndicatorDelay expires

Open cmastrandrea opened this issue 11 years ago • 15 comments

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:

  1. Enter text in the Input field
  2. Click the "Save" button
  3. 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)

cmastrandrea avatar Apr 08 '15 12:04 cmastrandrea

Hello, Thanks for pointing this out to us. We are taking this as a feature request and will keep you posted!

Best regards, Christiane

christianegoebels avatar Apr 09 '15 15:04 christianegoebels

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

christianegoebels avatar Apr 09 '15 15:04 christianegoebels

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.

cmastrandrea avatar Apr 09 '15 17:04 cmastrandrea

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

DMihaylova avatar Dec 02 '16 08:12 DMihaylova

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.

cmastrandrea avatar Dec 02 '16 12:12 cmastrandrea

Internally tracked: 1780089706

DMihaylova avatar Feb 03 '17 06:02 DMihaylova

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.

RalphMarshall avatar Apr 04 '17 19:04 RalphMarshall

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.

akudev avatar Apr 04 '17 22:04 akudev

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.

RalphMarshall avatar Apr 05 '17 13:04 RalphMarshall

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...

akudev avatar Apr 05 '17 19:04 akudev

Hi @cmastrandrea,

It looks like the solution has finally been implemented.

Best regards Benedikt

bendkt avatar Sep 17 '18 14:09 bendkt

Thanks Benedikt. Is this in an existing release or will it be available in the next one?

cmastrandrea avatar Sep 17 '18 14:09 cmastrandrea

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?

vxmn avatar Sep 16 '19 13:09 vxmn

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

stephania87 avatar Sep 16 '19 13:09 stephania87

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.

vxmn avatar Sep 16 '19 13:09 vxmn