Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed several issues with the knob control. #356

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrepxx
Copy link

  1. Control now gracefully handles empty input, falling back to zero
    instead of NaN.

  2. The control now also handles 'wheel' events instead of only
    'mousewheel' and 'DOMMouseScroll' events.

    Modern browsers use the W3C standard 'wheel' event when reporting
    scroll wheel events.

    This also prevents the site from scrolling when the cursor is over
    a knob and the mouse wheel or track pad scrolling is actuated.

    Previously, the web site would scroll away under the cursor as the
    user tried to actuate a knob with the scroll wheel or track pad,
    since the event was not properly captured.

  3. Increased the timeout for detecting mouse wheel stops from 100 ms
    to a more graceful 250 ms, which often works better.

  4. Removed the second timer (mwTimerRelease), since it messes things up.

  5. Added more key codes allowed for input, since the original set
    turned out too restrictive.

  6. Removed the speedup on long key presses, since this does not actually
    cause the increment to speed up, but instantly skips to the end of
    the range (min/max value) on a long press.

1. Control now gracefully handles empty input, falling back to zero
   instead of NaN.

2. The control now also handles 'wheel' events instead of only
   'mousewheel' and 'DOMMouseScroll' events.

   Modern browsers use the W3C standard 'wheel' event when reporting
   scroll wheel events.

   This also prevents the site from scrolling when the cursor is over
   a knob and the mouse wheel or track pad scrolling is actuated.

   Previously, the web site would scroll away under the cursor as the
   user tried to actuate a knob with the scroll wheel or track pad,
   since the event was not properly captured.

3. Increased the timeout for detecting mouse wheel stops from 100 ms
   to a more graceful 250 ms, which often works better.

4. Removed the second timer (mwTimerRelease), since it messes things up.

5. Added more key codes allowed for input, since the original set
   turned out too restrictive.

6. Removed the speedup on long key presses, since this does not actually
   cause the increment to speed up, but instantly skips to the end of
   the range (min/max value) on a long press.
@DaoFof
Copy link

DaoFof commented Apr 11, 2018

can we use this library in angular 5?

@andrepxx
Copy link
Author

andrepxx commented Apr 11, 2018

Probably you can.

Unfortunately, I can't give you support on that though. The control requires JQuery as a dependency, so if you can work with JQuery in your Angular project, you can probably work with this component.

You might also want to take a look at pure-knob, which implements a similar dial control, also with mouse, wheel and touch support, which has no dependencies. (So you do not need JQuery for it. It's just "vanilla" JS.) The repository is available from my profile or just search for pure-knob on GitHub. This might make things easier for you ... or perhaps not.

I'm sorry that I currently can't be more helpful. I'm just not familiar enough with Angular (yet).

@DaoFof
Copy link

DaoFof commented Apr 11, 2018

Thank you andrepxx to be so cool! I will search for how to use jQuery in angular while watching pure-knob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants