Code Monkey home page Code Monkey logo

elm-selectize's Introduction

Filterable Dropdown Menu Build Status

This is a customizable dropdown menu with the following features:

  • filtering the displayed entries with a textfield
  • keyboard selection using up/down arrow keys and enter/escape
  • auto scrolling if the menu is styled with a maximum height and overflow-y: scroll
  • you can insert non-selectable dividers between entries
  • the styling and rendering of the entries can be fully customized

If you like you can check out the demo.

elm-selectize's People

Contributors

amitaibu avatar kirchner 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

Watchers

 avatar  avatar  avatar

elm-selectize's Issues

Multiselectize: Unselected item isn't immediately added back into dropdown

(I am aware that MultiSelectize is not publicly released yet)

This issue shows up in both my own project and the demo. On the demo page, notice that if I select "Kermit the Frog" and then immediately unselect it, that item is not immediately available again in the dropdown. Instead, I have to close the dropdown first and then re-open it. Alternatively, if I select "Miss Piggy," "Kermit the Frog" is available in the dropdown without reopening it.

The cause is that the handler for the UnselectAt message does not touch the state in Internal.MultiSelectize, seen here.

        UnselectAt position ->
            ( state
            , focus state.id
            , Just (unselect position)
            )

Not updating the state here means that the change will not be picked up in the internal state until after the user unselects the item in their own model. Then the internal update will notice the change in another MultiSelectize.Msg like OpenMenu or Select.

I can submit a PR later if this fix is desired.

Allow multiple selection

I assume one could change the model to be something like:

type alias Model =
-   { selection : Maybe String
+   { selection : Maybe (List String)
    , menu : Selectize.State String
    }

Would have been lovely to see such an example (so I wouldn't have to do all the hard work, and just copy from what you've done ๐Ÿ˜‰ )

multi-select?

Have you thought more about the multi-select API? Would love to be able to do what's on the demo now.

Print page shows menu as a gray box

When printing a page the selectize menu shows up as a gray box occluding other content.

Please add this CSS!
@media print { div.selectize__menu { display: none; } }

SelectTree Message

Right now, SelectTree Message is emitted every time the User types in a Character or removes one.

I was under the impression that this Message will only be sent, if the User either selects an Item or clears the Selection.
Is the current behaviour desired?

add API to dynamically add or replace entries

hello

is there an easier way to update the menu entries?

this is my code but it can't find Entry or Divider so it doesn't work...

SearchResponse ((RemoteData.Success items) as data) ->
            let
                menu =
                    model.textfieldMenu

                addLabel e =
                    case e of
                        Entry a ->
                            LEntry a (toLabel a)

                        Divider text ->
                            LDivider text

                labeledEntries =
                    List.concat [ [ Selectize.divider "Cities" ], webDataToList data |> List.map Selectize.entry ] |> List.map addLabel
            in
            ( { model
                | textfieldMenu =
                    { menu
                        | entries =
                            labeledEntries
                    }
              }
            , Cmd.none
            )

multiselectize functionality in demo

Trying to find the source behind the multi selectize in the demo but unable to. I thought it would be part of the demo/demo.elm, all I found though was this issue saying that it isn't implemented in this repo: #2 dating back to august.

So is the functionality shown in the demo implemented in the repo? Confused... if yes, how do I do multi selection? ( as on further investigation, there are commits related to it! :)

docs: for autocomplete

I already figured out that putting a Cmd.msg on textfieldSelection is a good way to capture selection

But what is a good way to access the value of Attributes.value query in autocomplete?

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.