Selectric search within results - javascript

I'm using selectric - plugin for replacing select in forms and I'm struggling with the add search option, sadly this plugin does not come with such a feature.
I got to the point where I can create an input over label and refresh options after typing something, but it does not work as I expect. I got to this point:
jsfiddle http://jsfiddle.net/fcamjb57/
The issue is as you click the input, the whole select closes.

Related

Select2 - render search input instead of clickable select

Using select2, is it possible to render the search input instead of clickable select with search input in the dropdown, so the user can focus it immediately with either clicking it or going down the form
with a TAB key?
Default:
What I (roughly) need:
My guess: it is more friendly to end-user, as it saves him/her a click.
Reading the docs and googling I did not find any out of the box solution and before implementing one myself I just want to make sure there isn't any.

Multiple Key Value Query Search Input Box

I'm not quite sure exactly what to search for or where exactly to start, but I'm trying to see if it's possible to have a customized search box for multiple GET queries simply using jQuery, JS, HTML and CSS.
The user would first type in something which will prompt the red box to show (key) and it would autofill with a listed default given the first few characters they typed. Then upon pressing enter or tab, they would be allowed to fill in the answer gray box (value). Then after, they can either choose to submit or put in another key / value.
Is there a jQuery library that already has this implemented, and is this even possible? I thought about putting input boxes inside the input search box and using jQuery to hide and show them depending on what they type, but is that the best way?
I'd like to do this without comprehensive framework / library like Angular and React.
Thanks in advance!
You must handle it with one of JavaScript freamworks like Vue.js, React.js or Angular.js

Chosen multiselect does not show dropdown list on first click

When all the select options are removed from mutli-select, it displays data-placeholder value, which is fine, but clicking select box for first time, it does not pull the drop down. On second click the multi-select works fine.
This problem happens in all browsers. I also have found the same problem in demos showed in below link.
Is there any fix for this issue?
http://harvesthq.github.com/chosen/
It might just be the functionality of it. After clearing out the option, they may want you to double click on it to clear out the text.
However if you want to report the bug I would suggest doing it on their github page.
https://github.com/harvesthq/chosen/issues

interesting select box case?

Ok i am trying to make a select box like this used in following website
http://www.buildasign.com/PowerDesign.aspx?T=72486B387A61516563704442304E344F3068766947673D3D
When you will open the website link you will see a default word "Go" as selected. On left
side of drawing window there is size option which is of 91 value. But there are some fix values in select which never change like 8,10,12. How he is keeping one field which doesn't show in select(This value 91 doesnot show in dropdown) but still appears in it. Any help will be appreciated?
In a browser such as chrome, inspect the element and you'll see the text "91" is in a textbox, overlaid over the dropdown list. This simulates a combobox. There are various combobox jQuery plugins: http://plugins.jquery.com/plugin-tags/combobox
It's not a standard select box. But a textbox with some predefined text that is shown as an AJAX select box (a .NET control renderes data as a select box but it's not HTML select form element! just looks like it).
Spolto is pretty dead on with this one. The author of the site just set the text that way.
If you notice, the "drop-down" is still text typable, so despite the options you can type any set of digits there!

How to make input not to lose focus when clicking on scrollbar in suggestion list

I'm testing TagDragon jQuery plugin, it's exactly what I need, but is has one annoying "feature", when I click the scrollbar in the suggestion list, it hides it's results. On the other hand jQuery autocomplete plugin doesn't lose the focus on the input field and that's why it doesn't hide its results. But that plugin doesn't provide the functionality I need, so I can't just replace tagdragon.
I've studied jQuery autocomplete code and I can't understand how they keep the focus on the input field, I just can't find the code responsible for that!
So the question of the day is: How to keep the focus on the input when using the scrollbar in the result suggest list?
P.S. Also I have a question of how jQuery autocomplete plugin does it, because it looks like magic to me after studding the code for an hour.
I just asked a similar question, and nobody answered it, so I basically tweaked my own code until I figured out a working solution.
After investigating some of the other pickers out there, I realized that the trick is not to add an event that closes the list on blur, instead simulate a blur event by checking other possibilities by doing the following:
upon the opening of the list, add a click event to the document that
checks to see if the click is not on in the active input, and not on
the active list. If this is true and the click is in fact on a non-listy
part of the document, then close it.
add an event to each list item in the suggest list (when the list is
open only) that selects the value and closes the list.
add an keydown event to the input itself so if the user hits enter,
it changes the value and closes the list.

Categories