openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.m.StepInput mouse wheel issues

Open zypA13510 opened this issue 7 years ago • 5 comments

OpenUI5 version: 1.60.2

Browser/version (+device/version): Chrome Version 73.0.3642.0 (Official Build) dev (64-bit) Ubuntu 18.04.1 (Desktop)

Any other tested browsers/devices(OK/FAIL): Firefox 64.0 (FAIL)

URL (minimal example if possible): http://jsfiddle.net/zypA1310/L4gpkzc8/

Steps to reproduce the problem:

  1. Make sure the StepInput is not focused
  2. Move the mouse on top of the StepInput
  3. Mouse wheel up, until StepInput displays 70. 4a. Click submit 4b. Click the add button (plus sign) beside the StepInput

What is the expected result?

At step 3, the output is changed with StepInput, and at step 4a, 70 is shown in the message box. At step 4b, StepInput displays 71.

(Actually I believe it is more appropriate to disable the mouse wheel behavior altogether, because a user unaware of this functionality may unintentionally change the data when they intended to scroll the page up/down. At the very least, make this behavior configurable, e.g. provide a handleMouseWheel options)

What happens instead?

At step 3, the output is changed with StepInput, and at step 4a, 50 is shown in the message box. At step 4b, StepInput displays 51.

zypA13510 avatar Jan 08 '19 10:01 zypA13510

Hello @zypA13510 , Thank you for sharing this finding. I've created an internal incident 1970017557. The status of the issue will be updated here in GitHub. Regards,

fifoosid avatar Jan 08 '19 12:01 fifoosid

I believe it is more appropriate to disable the mouse wheel behavior altogether, because a user unaware of this functionality may unintentionally change the data when they intended to scroll the page up/down.

I fully agree with this, but apparently it's the default behavior of some of the browsers that manipulating on mousewheel works at all on <input type="number>". For example: https://interactive-examples.mdn.mozilla.net/pages/tabbed/input-number.html

  • Edge, Safari: Doesn't work
  • Chrome, Firefox: Works

The issue here would be rather that altering the value on mousewheel applies also on hover which is very annoying and irritating, whereas the native behavior of some of the browsers is on focus.

IMHO the default behavior in UI5 should be aligned with the default behavior of the browser.

boghyon avatar Jan 08 '19 13:01 boghyon

@boghyon I don't know why but the exact same jsfiddle doesn't work on Chrome, so I mistakenly believed that it was no longer the default on browsers. But your MDN example (which works for me on Chrome) proved me wrong. Thanks.

As for the default behavior, I believe that a unified behavior is probably more preferable instead of following the default behavior of browser. Either the mousewheel event (on focus) is handled on all platforms or not handled at all, otherwise, it may cause some confusion?

zypA13510 avatar Jan 08 '19 14:01 zypA13510

@zypA13510 I realized Chrome somehow doesn't show this behavior if the input element is within an <iframe> in contrast to Firefox. (JSFiddle doesn't seem to support running the code without any iframes, but it can be tested in the Network preview tab from the dev tool). The MDN sample runs without an iframe.

About the default behavior: A consistent behavior would be really nice. It's just the ambiguity which platform the consistency should be based on: Browser or some framework (UI5)? My assumption is that browsing history of an average user consists of various websites (not just UI5 apps) but using mostly one browser. Hence favoring browsers as the basis for consistency over frameworks. But that's just my opinion.

Either way, I think we can all agree that manipulating the input value on mousewheel on hover is a bad UX pattern. :)

boghyon avatar Jan 08 '19 15:01 boghyon

So far, I've been able to fix the issue in #2356. However, the input will not be altered when the outer control is focused while the real input inside is not i.e. no cursor inside the input (e.g. after pressing the +/- button). test preview

I'm not sure what should be the expected behavior, as in a browser-native <input type="number">, you cannot have it focused but without the cursor inside.

zypA13510 avatar Jan 09 '19 03:01 zypA13510