Skip to content
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

Make sure matching string in option text will be wrapped by "<em>" #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/ajax-chosen.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/ajax-chosen.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/ajax-chosen.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ do ($ = jQuery) ->
# the input field.
field.val(untrimmed_val)

# Make sure matching string in option text will be wrapped by "<em>"
# since "liszt:updated" will call "results_update_field" -> "results_build" -> "show_search_field_default", search_field.value will be cleared
# so trigger 'keyup' to call "results_search" -> "winnow_results" to highlight search result
field.trigger("keyup")

# Because non-ajax Chosen isn't constantly re-building results, when it
# DOES rebuild results (during liszt:updated above, it clears the input
# search field before scaling it. This causes the input field width to be
Expand Down