hernansartorio / hernansartorio/jquery-nice-select
Event Handler for Autocomplete and Click Off
- Dominant language
- JavaScript
- Stars
- 955
- Forks
- 271
- PR merge metrics
- No merged PRs in 30d
Description
Can you include some changes that will help event handling with validation?
I added a local method to handle updates
`// update method for autocomplete
function update() {
$(this).niceSelect("update");
}`
In the create_nice_select method, I added a binding that will call that local method when the select is changed:
`$select.bind("change", update);`
I unbound it back up in the string method handler (so when you call the destroy method:
`$select.unbind("change", update);`
lastly, I added the blur functionality to the part when you close when clicking outside.
`$('.nice-select').prev('select').trigger('blur');`
Thanks,
Robert
Contributor guide
No contributing guide indexed for this repository
Research direction
Find the plugin source containing create_nice_select and the string method handler. Review the proposed change, including the autocomplete update binding, its removal during destroy, and triggering blur when clicking outside. Done means validation-related change and blur events behave correctly without leaving a handler bound after destruction.
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
- 45/100