GithubHelp home page GithubHelp logo

lcvriend / wc-multi-selector Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 67 KB

Web component that lets a user select multiple options from an arbitrarily nestable hierarchy within a drop-down menu

License: GNU General Public License v3.0

JavaScript 55.36% CSS 20.16% HTML 24.48%
js keyboard-navigation multiselect nestable omnibox searchable-dropdown vanilla-js web-component

wc-multi-selector's People

Watchers

 avatar

wc-multi-selector's Issues

selected attribute not working

Hi, i tried to create a nested optgroups with this plugin.
But pre-selection with "selected" attribute on DOM load seems to not working.

...
<option value="1" selected>TEST 1</option>
...

I'm expecting that TEST 1 is selected on load page, but nothing is selected...

Fix "expand +/-" css for scrollbar

Hi I suggest a little fix causing scrollbar "hide" the + (or -) symbol at the right of lists:

[data-role="group"] > summary::after {
   ....
  margin-right: 9px;
}

immagine

submit values as array instead of JSON string

Hi another question: during form submit, values are always passed as JSON string like ["1","2","8"]

So in my index.php page I need to manipulate data from multi-selector (convert from JSON to ARRAY) in a different way from other submitted traditional data:

<?php
     $json_id_from_multiselector = $_POST['ids'] ?? "";
     $array_ids = $json_id_from_multiselector != "" ? json_decode($json_id_from_multiselector, true) : []; //<-- json to array
     ...

Any chance that during submit, data is already submitted as array? Thanks for your time

Originally posted by @itajackass in #1 (comment)

Possibility to translate default text using options

Hi, if you can, i'd like to suggest new options for translating default strings without editing the code (i'm italian).
I suggest option to replace default text string for:

  • ALL ITEMS
  • UNFOLD GROUPS
  • FOLD GROUPS
  • SHOW SELECTED
  • CLEAR FILTER
  • SEARCH ... (placeholder)

Thanks

[Request info] Methods available

Hi, is there any methods to use?
For example i'd like to use this plugin in a search page: actually seems that search can be done only using ajax cause there is no way to preselect some "option" (option value="x" selected) on DOM/PAGE load.

So I ask if there is a method to use with jquery (on document ready) to set as "selected" some IDs from select to prevent using ajax.

Thanks

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.