davetayls/jquery.kinetic

Only show non-default cursor if scroll container can be scrolled

Closed this issue · 1 comments

Currently, the move cursor (or whichever else) is shown even if the container actually can’t be scrolled. For (mouse) users, this sets a wrong expectation that the container can be scrolled in case it doesn’t.

It's easy enough to check for scroll with container.scrollWidth > container.clientWidth and container.scrollHeight > container.clientHeight, but the check needs to be repeated on orientationchange and resize of window, which adds a bit extra complexity for a small improvement, so I leave it here for your consideration.

Thanks!

You could set the cursor setting to '', maybe null not sure, I can't remember how jQuery treats that. Then do the checking in another place.

See: https://github.com/davetayls/jquery.kinetic/blob/master/jquery.kinetic.js#L118

this.$el
      .addClass(ACTIVE_CLASS)
      .css('cursor', this.settings.cursor);

If you can see a nice way of integrating it into the plugin, feel free to submit a PR and we can review it from there.