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

Search tag position option #4008

Closed
wants to merge 4 commits into from

Conversation

stretch4x4
Copy link
Contributor

Fixing issue #3420
Adding an option to move the location in the search list of the typed tag to the bottom.
We needed this as the users were hitting enter and saving their tag instead of the matched item.

Fix for: createSearchChoicePosition removed in select2 4.0 withour
replacement select2#3420
Now there is an option to specify whether the new tag appears at the top
or bottom of the list
@kevin-brown
Copy link
Member

I was planning on adding this as an option at some point (insertTag perhaps), similar to how createTag and sorter work. As a result, I'm hesitant to accept this pull request because I'd rather support a more generic option that inserts the tag into the results instead of a specific option that controls the location of it.

@kevin-brown kevin-brown added the 4.x label Dec 9, 2015
@stretch4x4
Copy link
Contributor Author

That sounds fair..
I will have to try to take a look at createTag and sorter to see if I can figure out how that would work..
It might be pushing my abilities to try to do that myself..
But would like to help fix this issue so that next time we upgrade I don't break anything.

Now the option is the function you want run to make it more flexible
@stretch4x4
Copy link
Contributor Author

Figured out what you meant and that was much simpler than expected so have updated to that approach :)

@kevin-brown kevin-brown added this to the 4.0.2 milestone Dec 10, 2015
@kevin-brown
Copy link
Member

I've manually committed this in e842797, which is almost the exact same commit as stretch4x4@7276620. I also built out a (very basic) test for this in db5e947.

@stretch4x4
Copy link
Contributor Author

Cheers

tzellman pushed a commit to tzellman/select2 that referenced this pull request Feb 2, 2016
This adds an option called `insertTag` that controls the location within
the results where the tag is inserted. The function should take in the
results array and the tag, and should modify the array in-place to add
the tag to the results.

This closes select2#3420
This closes select2#4008
@stretch4x4 stretch4x4 deleted the search_tag_position branch March 4, 2016 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants