-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Determine the correct target before onFilter #157
Conversation
Updated PR with a fix for the index method. |
// Check filter | ||
if (typeof filter === 'function') { | ||
if (filter.call(this, target, this)) { | ||
_dispatchEvent(el, 'filter', target); | ||
_dispatchEvent(el, 'filter', target, undefined, startIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is bad, onFilter
should to work with evt.target
.
Add variable originalTarget
:
originalTarget = (touch || evt).target,
target = originalTarget
// ...
_dispatchEvent(el, 'filter', originalTarget, undefined, startIndex);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
el
-> originalTarget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_dispatchEvent(originalTarget, 'filter', target, undefined, startIndex);
;]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated PR.
|
||
// get the index of the dragged element within its parent | ||
startIndex = _index(target); | ||
|
||
// Check filter | ||
if (typeof filter === 'function') { | ||
if (filter.call(this, target, this)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target
-> originalTarget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated PR. Also updated target
-> originalTarget
after the filter.split(',')
line.
Determine the correct target before onFilter
Fix #156 and also returning correct indexes if a drag handle is present (#154).
How does this impact the example code for
closest
?