lcdsantos / lcdsantos/jQuery-Selectric
Click event does not fire on nested elements inside li tags
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 715
- Forks
- 149
- PR merge metrics
- No merged PRs in 30d
Description
When using the optionsItemBuilder function and add new tags, click event does not fire on new elements. It happens because return false; in this part of the code
_this.$li.on({
// Prevent <input> blur on Chrome
mousedown: function (e) {
e.preventDefault();
e.stopPropagation();
},
click: function () {
_this.select($(this).data('index'));
// Chrome doesn't close options box if select is wrapped with a label
// We need to 'return false' to avoid that
return false;
}
});
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the optionsItemBuilder implementation for the shown _this.$li mousedown and click handlers, then reproduce the problem with a nested element inside an li. Check that clicks on nested elements fire while preserving input blur prevention and label behavior; done means the new elements respond to clicks without breaking option selection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, jquery
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100