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

select2-match (underline) doesn't happen #109

Open
blimmer opened this issue Jul 2, 2015 · 2 comments
Open

select2-match (underline) doesn't happen #109

blimmer opened this issue Jul 2, 2015 · 2 comments

Comments

@blimmer
Copy link

blimmer commented Jul 2, 2015

Is there something you have to toggle to get this behavior? The jQuery select-2 implementation splits the results as you type and applies the select2-match class to the matching characters as you type:

jQuery select2

ember-select-2

I couldn't see why this wouldn't be happening the same way. Anyone have ideas on this?

@blimmer
Copy link
Author

blimmer commented Jul 7, 2015

Looks like this is because the select2 component is implementing its own formatResult which overrides the application of the underline class.

This post describes how to use the exposed utility method (window.Select2.util.markMatch) to apply the span that handles the underline.

I've got a prototype of this working locally:

I would love to see this behavior added, and am willing to do a PR, but I want to make sure that @iStefo is cool with this. There are a few outstanding questions:

  1. Are we comfortable SafeString-ing the results of the Select2.util.markMatch method?
  2. Does this need to be behind a flag? My initial thought is "no" because it's the default behavior of Select2, but others who have been using this library might be relying on this behavior (no underline).

@ronco
Copy link

ronco commented Jul 27, 2015

@iStefo This would be great. Also it'd be great to allow overriding the formatting of result altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants