jquery / jquery/api.jqueryui.com

Documentation of Mouse Interaction is very incomplete, somehow confusing, and lacks examples

Open
#209 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
73
Forks
74
PR merge metrics
No merged PRs in 30d

Description

http://api.jqueryui.com/mouse/

This part of the documentation needs serious improvement, and/or a corresponding dedicated section in Demos, which does not exist.

  1. (this applies to several methods but I take _mouseStart() as an example)

_mouseStart()Returns: jQuery (plugin only)

The extending widget should implement a _mouseStart() method to handle the beginning of an interaction

=> Explain how the widget author is supposed to implement this method. Because the obvious apparent meaning is that you are expected to implement it in this way:

$.widget("my.widget.name", {
  //....
  //....
  _mouseStart: function() {
    //my definition of the method. e.g.:
    alert("Mouse interaction starting");
    return this;
  }
});

but that's not the case, as this way the method won't ever be called.

The same applies to all the other methods of this part of the api (_mouseCapture, _mouseStop, _mouseDrag...)

  1. The following can be seen in the documentation of most of these methods:

This method will receive the mouse event associated with the start of the interaction.

  • This method does not accept any arguments.

There's an apparent contraddiction there.

  1. Code examples. The current code examples are completely useless. Most (or all) examples are like this:

Code examples:
Invoke the _mouseStart method:

$( ".selector" ).mouse( "_mouseStart" );

That or no example at all is the same. A useful example would be an example implementation of the method, rather than an example of calling it which is something you wouldn't usually do.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mouse interaction API page at http://api.jqueryui.com/mouse/ and review the _mouseCapture, _mouseStart, _mouseDrag, and _mouseStop entries and their existing examples. Done means clarifying how widget authors implement these hooks, documenting the event arguments, and replacing invocation-only examples with useful implementation examples or a linked demo section.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.