Giter VIP home page Giter VIP logo

jquery-nice-select's People

Contributors

hernansartorio avatar jsimnz avatar robmarston 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

jquery-nice-select's Issues

Different LICENCE

Contradictions found

  • package.json LICENCE - ISC
  • bower.json LICENCE - MIT

It's a typo or is it so?

Multiple select

Hello Herman, really nice work! I have a doubt, you will have support for multiple select?? that will be really awesome!

Regards

Not working when placed in <label> tag

To reproduce: wrap the selectbox to be styled with a <label> tag.
Why: because clicking nice select bubbles to the label tag, which in turn triggers click with event.target set to the native select element, so the plugin treats it like "clicking outside".

not work on ajax requests

Thanks for great plugin. when a page is loaded via Ajax the select elements doesn't turn to nice select .it seems niceSelect() function does not work on ajax loaded pages

add data-imagesrc to display images

Hi,

Great lib!!
How can we add the possibility to show images in the newly created dropdown? I was thinking about using something like data-imgsrc=some-image.png which will be added as image in the dropdown.

Any pointers or help appreciated :)

The return value for sending a form

could not pass a value through a post form. We made improvements :
after line 82:

                .addClass('option' +
                    ($option.is(':selected') ? ' selected' : '') +
                    ($option.is(':disabled') ? ' disabled' : '')).html($option.text()));
/// add link for dom element Option
        $dropdown.find('ul li:last').get(0).niceSelectItem = $option.get(0);

onClick event
after line 121:

 $option.addClass('selected');
/// correct selected Option element on Select tag
 $option.get(0).niceSelectItem.selected=true;

and after line 150 and line 162:

$next.addClass('focus');
$next.get(0).niceSelectItem.selected=true;
$prev.addClass('focus');
$prev.get(0).niceSelectItem.selected=true;

Blurry text when using Nice Select

I have a problem, when using Nice Select, during animation, all texts on the page are getting blurred. I noticed that on the jQuery Nice Select demo page there's no that issue. Ho to overcome this?

Callback on select?

Is there a way to get a callback function once a selected value has been checked?

Can we have any example with Backbone app

JQuery nice select is good when we not using any framework. But can we make it with Backbone library.
eg:
events: {
'click .btn-clear-event': 'resetFilter'
'click .btn-event-register': 'eventTracker'
'change .selectList': 'eventFilter'
}

however its not working for me.

`readonly` attribute is ignored

The value of readonly select elements should not be modified.

Currently, nice-select displays the selected value, not the value set readonly.

Unable to reset select value to default

Hi All,
I want to reset dropdown list. I can able to reset "" list but not "nice-select" list. Can you please help me? Here is the code. $('.clearItem').on('click', function(e){ e.preventDefault(); $('.event-list li').removeClass('hide'); $('.select-events-filter option').prop('selected', function() { return this.defaultSelected; }); e.stopPropagation(); }); // $('.clearItem') is a button

Up/down arrow not rendered correctly in IE9.

Instead of rendered as arrows, it looks like this:

screen shot 2016-02-12 at 9 08 09 pm

BTW, it's an awesome plugin! Light-weight, slick, and works almost anywhere!

Would be great if the IE9 arrow issue can be fixed.

Nice select list at bottom of page does not show all entries

I have a select list at the bottom of my page and use the jquery-nice-select plugin to make it look nicer. When I open the nice select list it makes my page longer, instead of (like normal select boxes would) being shown on top (see attched screenshot).

Is it possible to mimic the behaviour of the default select list?

Thanks

Short field, big options

I had to add this code in css to fix the issue when the field is short, and the content is big, clipping the words. Hope this helps other people.

.current { display: block; overflow: hidden; }

How can I set a value with Jquery ?

Hello , my friend , wonderful script . Congratulation .
I have a question , I am trying to change the value with the jquery , like this -

$(document).on('click', '.edit-item', function(event){
$("#myselect").val(1);
}

or
$(document).on('click', '.edit-item', function(event){
$('#myselect>option:eq(3)').prop('selected', true);
}

but is not changing , maybe has some script that has to tell the jquery to refresh , after on click .
Do you know what do I have to do to make it works ?
Thanks

does not show optgroup

I have a select menu containing items like :

 <select>
  <optgroup label="Swedish Cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
  </optgroup>
  <optgroup label="German Cars">
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
  </optgroup>
</select> 

but only options are displaying in list and no optgroup label is showing

Disabled not working properly

There is a tiny bug in code, line 14:

(select.attr('disabled') ? 'disabled' : '" tabindex="0') +

it should be:

(select.attr('disabled') ? ' disabled' : '" tabindex="0') +

A space is needed before 'disabled' (same as before tabindex), currently it appends 'disabled' to last class name and it's not working right.

setting selected does not update on screen

Using:

$("#selectorTest").val(value);

On a <select> element does not update the currently selected option.

Using

console.log($("#selectorTest").val())

Logs the expected value.

Refreshing the page will update the <select> to the set option.

Standard <select> elements will update their selected option immediately when using jQuery.val()

jQuery(...).find(...).niceSelect is not a function

I'm using nice-select in a richfaces based jsf application.
Everything works fine.
But after any ajax request and partial re-rendering of the page, next subsequent call to nice select will fail with error:
jQuery(...).find(...).niceSelect is not a function.
Because of this error i'm not able to continue operation.

multiple select not working

When native select has a "multiple" attribute, the user is allowed to select more than one item.
Currently this is not the case in nice-select

Attribute "tabindex" does not clone to the div element

Hello,

on line 62 you wrote:
.attr('tabindex', $select.attr('disabled') ? null : '0')

but if the original select element has a "tabindex" attribute, it returns to zero. So, I try this:
.attr('tabindex', $select.attr('disabled') ? null : $select.attr('tabindex') || '')
and it works.

"Displayed but not selectable" for select items?

Would you consider adding "displayed but not selectable" for select items? More specifically, display an item in a select list, but user can't select it.

This is useful to inform user that some item is present, but not available for choice. Alternatively, one can simply hide such an item, but sometimes users can be confused as to where particular items are.

Not working in IE8

Is it possible to make it work in IE 8? Basic functionality at least.

Regards,
Raman

Prevent alphabetical sorting

So I'm basically reading out the options from a text file and then nice select orders them alphabetically although I need the exact order from my file. Does anybody know how to prevent this sorting?

webpack - npm - react

HI I am havin trouble using this with npm..I did:

npm i jquery-nice-select --save

in my js file:
require('jquery-nice-select');
$('probes-select').niceSelect();

but I get the err that niceselect is not defined.

license

Hi, can you add information about license? Is it open source or not?

[request] add class when focused with tabindex

Hello,

I've seen that the plugin supports tabindex and keyboard selection, but it would be nice to add a class when the nice-select is focused with tabindex.

If you agree, I can make a pull request.

Thank you.

Deny selecting of disabled elements

Firstly, I'm using this cool plugin in most of my projects. Thank you a lot for it!

It would be great to make disabled select elements grey or something.

I think I could try to implement it by myself. I can create a pull-request with my changes. Is it interesting for you? It would be really nice for me to participate

Change display value depending selected count

Hi there !
First, thanks for the awesome plugin.

Here's what i try to achieve :

  • change the display value (attribute data-name) depending the filter count
  • for example, if more than 3 selected items, use attribute data-short-name

I was able to do this with the PHP side, means it work on refresh as i count the number of selected items. But I want to make it work on select, the JS way.

Maybe I can use #25 as inspiration ?

In the end, changing on the fly NiceSelect settings to use another attribute, or be able to change data-name value and refresh NiceSelect ?
Thanks a lot

Baseline Accessibility Audit

This plugin works visually, but fails in complying with many a11y requirements. For example a user that navigates primarily by keyboard will have to press down 180 times to select Uganda. In order to get this plugin at minimum ADA / ARIA compliance, please implement the following:

  • typeahead navigation
  • aria-* attributes for better form navigation and screen reader support

"Dropdown" div can't be moved before the select

Reading the code, the select MUST be before the div
I use (no choice) a form validation plugin that writes error messages just after the element so in this case, between the select and the div which breaks the layout: label ; hidden select ; error message ; displayed dropdown

isn't there another way to get the origin select from the niceselect instance so that div and select would not have to be in a specific order anymore?
like adding a kind of "data-niceselect-id" random string

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.