Git Product home page Git Product logo

selectize / selectize.js Goto Github PK

View Code? Open in Web Editor NEW
13.0K 13.0K 3.6K 26.69 MB

Selectize is the hybrid of a textbox and <select> box. It's jQuery based, and it has autocomplete and native-feeling keyboard navigation; useful for tagging, contact lists, etc.

Home Page: https://selectize.dev/

License: Apache License 2.0

JavaScript 21.99% Makefile 0.14% CSS 0.36% Less 24.62% SCSS 48.51% HTML 4.38%
bootstrap css hacktoberfest input javascript jquery jquery-plugin select tagging

selectize.js's People

Contributors

abhij89 avatar brianreavis avatar comerc avatar dependabot[bot] avatar dosource avatar fabienwnklr avatar github-actions[bot] avatar graingert avatar jhash avatar joallard avatar marcandre avatar micahjon avatar mpokrywka avatar olegatro avatar parsonsmatt avatar paulkolbovich avatar pictor13 avatar reklatsmasters avatar risadams avatar roblevintennis avatar rotdrop avatar ryanwersal avatar scottmitch avatar sjhewitt avatar tiush avatar topaxi avatar urban avatar viktorqvarfordt avatar yoyuum avatar zeitiger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

selectize.js's Issues

Not understanding plugin loading

The docs state that plugins.js should contain the plugin code. I copy the code from dropdown_header into plugins.js but get multiple console errors.

What is the proper structure for loading plugins.

Selectize does not inherit classes from original input/select

In our grid layout we give elements span* classes, similar to that of Bootstrap. Our original select element includes one of these so that we can create a nice and neat form layout.

When you apply Selectize however to the elements, the new element doesn't include any classes or original markup. Similar to the problem in #13.

Better onChange API

Currently onChange only returns the value of the selected item. It'd be much more useful if it returned say, the object that is used to display the item, similar to how render.item works.

Unable to enter text in any Selectized select on iPhone 4S with Safari

SYSTEM:

iPhone 4S (iOS 6.1.3) - Safari

REPRODUCTION STEPS:

Go to your website and look at the first demo ("Tagging"): http://brianreavis.github.io/selectize.js/

If I 'click' on the select area, it highlights itself briefly (as if Safari was going to give control to it) but then nothing happens.

COMMENTS:

After going through the rest of the demos on that same page, it seems like Selectize works fine as long as no text is being entered - i.e., any of the demos where it's just acting as a normal select are okay.

Perhaps this is expected, but I figured I'd mention it just to be safe.

Required field cannot be focused

If the original element is required, Selectize will correctly copy the property. If the user doesn't fill in the field and tries to submit the form, then the browser will try to focus the field to alert the user to their error.

Selectize doesn't seem to respond to this, resulting in a console error of An invalid form control with name='input_name' is not focusable.

It seems that the browser (at least Chrome) won't (correctly) send focus to hidden elements, so really Selectize needs to remove the required property from hidden fields and respond to a focus event.

Can't interact with Scrollbar

I'm unable to interact (drag) the scrollbar on Chrome, Safari and Firefox on my Mac (haven't been able to test other browsers yet) .. The list closes as I try to click down on the scrollbar. I suspect it's an erroneously delegated eventhandler :)

Hope this hasn't been brought up already, I did scan for something similar.

Regards, Si

i18n

Suport for multiple languages.

Text to create new item is hardcoded english.

TravisCI

Just an idea, have you thought about using TravisCI for building the main library upon a pull request?

Options being displayed when input is emptied

First our setup. We have an input box which we then apply Selectize.js to. Next to the input is a dropdown which effectively changes what type data we send in the load function. Also, we have an object containing several bits of information to control what data we send and what the templates are depending on the search type.

After typing a search query the callback is sent, but the data doesn't load, until you backspace everything in the input. The output of your results will then be listed.

You can see a video of this in action, here.

chained select like city-state

hello..
i'm a student, i'm in an internship periode and got job to develop a website.
i want to make a chained select like city-state. i use multi dimentional array from json encode to store category(id category, name) and type(id category, id type, name). if the category change, the type will change too, refer to which category selected.
can you teach me the simple javascript for steps of using onChange? i do this for few days, and still failed.

Unable to query original select

When you select an option with selectize it changes the original select component adding an option with the selected value

for (i = 0, n = this.items.length; i < n; i++) {
                options.push('<option value="' + htmlEntities(this.items[i]) + '" selected="selected"></option>');
            }

I think the option component should reflect exactly how the original option was (including the label) so the user can query the select component and get the label and wherever data he wants from it.

Add destroy method

A destroy method to complete remove Selectize from an element would be nifty. I'm currently cloning a div which contains three inputs, one of which is Selectized and although I'm cloning with both options of .clone as false, Selectized gets copied too.

So, I'd like to destroy it, then re-create it.

Text and value both same in selectize.jquery.js

Can somebody explain why the jQuery plugin initializes selectize a text and value attribute with the same values? See here.

This is causing issues for us as our tags use one value for the tag label and another for the actual value which we send back to our server.

Surely something else should be occurring here?

Select input loses focus after selecting item

When selectize applied to a select input, and a selection is made (with the keyboard or mouse,) the focus is lost. This makes it a pain to tab around the form, as after you select something the focus is set to the body element. Compare this with a native select input that keeps focus on the input after it has closed.

I've hacked together a bit of code that returns the focus to the input element, however it's not great. Perhaps the best way would be to insert an invisible element to take the focus after an item is selected?

Change being triggered twice

$('#user_address_state').selectize({
  onChange: function(value) {
    console.log(value);
  }
});

when I select an option, this method is called twice, one with value being empty and a second time being the correct value.

Allow change the 'Create xxx...' string

so this is a minor feature request, I would like to have the option to change the string appears when user add a new attribute the is not in the list.
I already done this on my setup, since it's just adding (this.settings.new_string || 'Create ') where the 'Create ' is hardcoded and then give the selectize function 'new_string'

Release on NPM

It would be call to have selectize on npm, especially for those using CommonJS browser bundlers such as browserify.

Preload Callback

A callback for when preloaded data has been fetched and added would be nice.

"change" event being triggered twice (mode: "single")

The value of the select element does not post to server on ajax post.

This error cause by calling function clear() in Selectize.prototype.addItem(). In clear() we call updateOriginalInput() with data = "" and then the input (select) is trigger change with val = "" so the value "" is posted to server.

When user change option in select, the change is envent is triggered twice (in clear() and addItem()).

Can not select an option with value=0

I have a options (key => value) like this:

0 => option 0
1 => option 1
2 => option 2
3 => option 3

When a select has options like that, i can not select "option 0" because the data-value for "option 0" is empty
selection_371

LocalStorage caching

Using a remote source is great and all, but some times that data may never change, or won't for a long time. How about an option to locally cache the returned data into Local Storage if it's available and use that source rather than fetching data all of the time.

Removing all options

I tried to remove all options from a selectized select and couldn't find any function to help me. Is there any way?

Virtual keyboard is still activated on iOS device after "onItemAdd"

I compose the item list by using a remote source. However, after I select an item, the virtual keyboard is still on.

I looked at the official demos and I found it not even activate the keyboard at all when the input is focused.

Tested on iPad mini and iPhone 4s, both iOS 6+.

Hope I did not do something wrong.

Include static options when using remote source

I have a select element which contains 10 static options, when using a remote data source in load these items get overwritten.

Selectize should respect the default content of its select element.

Preload remote data

Currently Selectize doesn't preload any data, so when you're using a remote source and call addItem before you've manually typed anything, nothing will happen as the data hasn't loaded yet.

Obviously it'd be better to give this its own option, so you can decide if you want to preload anything or nothing.

Keep original select and selectize in sync

Is there a way to keep both selects options in sync? I'm asking that because it's easier to work with the original select than with selectize select.

Original select:

var $select = $('select');

Selectize select:

var $select = $('select').selectize(options);
var selectize = $select[0].selectize;

nouse param in debounce_events

in the function debounce_events where in line 77 of selectize.js / src / utils.js
there is no business of the 2nd param types, it unuse here, but it made me thought it does.

/**

  • Debounce all fired events types listed in types
  • while executing the provided fn.
    *
  • @param {object} self
  • @param {array} types
  • @param {function} fn
    */
    var debounce_events = function(self, types, fn) {

Selectize not showing over content

I am looking into using Selectize in our application but I ran into a problem wich im not entirely sure whos fault this is...

When using a vanilla select I get:

selectize-yesyes

When using a Selectize select I get:

selectize-nono

Also in a Boostrap the Selectize box is under the content and creates a scrollbox.

selectize-modal

I hope we can figure out what I can do to get this right I love the way Selectize works and looks =]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.