Giter VIP home page Giter VIP logo

much-select-elm's People

Contributors

jachin avatar mustafamuse avatar sbone avatar

Stargazers

 avatar

Watchers

 avatar

much-select-elm's Issues

Clicking on opt group label causes a flash

Click on an option group label in the drop down menu cases the dropdown to flash.

The cursor should also change when hovering over opt group labels to an arrow to show the user that they can not click on them.

Example Saving a Custom Option

An even more complex example where

  • new CustomOption s are submitted to an API in addition to getting other options from an API (maybe we use local storage to make this work).
  • Make sure that an initial value works, even when that same option comes from the API.
  • Options (from the API) should include descriptions.

Selected option jumping to the bottom

When trying address the issue of the initial multi selected values' order not being respected I introduced a bug where in single select mode the selected option would jump down to the bottom of the dropdown.

Disabled Options Should Be Visible

Disabled options are not showing up right, they should be visible, but not highlightable or selectable. They should probably look faded as well.

Nicer Event Viewer

A nice event view for the demos. A little widgets that shows the relevant event firing, then automatically clearing.

  • message that show up then disappear.
  • color coded messages
  • Looks nicer

Dropdown width

the width of the dropdown should always track with the width of the element, it doesn't need to have a max size.

Value Encoding

Right now we are just using a comma separated value, but this is trouble if the much select value has a comma in it.

Let's add an attribute to specify how exactly the value gets "encoded" in the selected-value attribute.

Hidden Input Slot (Support HTML Forms)

We need to support having a lot (in the light dom) that is a hidden input with a value that is reflected by the value of the <much-select>, this will allow "traditional" form submissions to work.

Dropdown Ordering Webtest

There's a todo item in the dropdown-ordering.test.html, we need to get that test working. There is probably something actually broken here.

Add custom options label

When adding a custom option there's a bit of text to give the user a hint that they can "add" a new option, not just select from one of the given options. Make that text customizable.

Multi Select options could stay in the dropdown

When in multi select mode, we could (optionally) keep the options in the dropdown (in place) and just show them as selected in the dropdown (in addition to in the input).

The would probably be implemented with an attribute, I'm not sure what the default behavior should be.

Dropdown Footer

The dropdown footer is made visible by an attribute, something like show-droppdown-fotter.

The idea is that it's used with the max-drowpdown-items attribute and with searching.

So if the user can only see some of the available options because there either isn't room or the search filter is hiding some of them it would say something like.

Showing 8 of 167 options

Add an blurOrUnfocusedValueChanged event

The idea here is this in an event that gets emitted when a <much-select> is blurred AND it's value has changed. It should also get emmited if the value is changed without focusing the <much-select>. I think the only way to do this now is with the clear button (in multi-select mode).

Allow for explict ordering of the options

When adding an option there could be an additional field that is the order the options should be in when displayed in the dropdown.

This could be done with some sort of rank or order property.

Naked Options

Allow naked options in the dropdown.

<much-select>
  <option>hello</option>
  <option>hi</option>
  <option>how are you?</option>
</much-select>

Placeholder Slot

Right now the way it's styled.. the element doesn't show up until the element is "ready".

If there are a lot of <much-selector> s on the page it can take a few minutes... and there's "jitter".

Maybe there should be an optional slot that has a placeholder in it, that shows the selector in a disabled state. It's tricky because it will require external styling. But you probably want that anyway, to hide the select menu in the slot.

Always sort options (and optgroups) alphabetically

We could also have an attribute to just always sort the options alphabetically.

This would need to support sorting them with in option groups.

This could be important with the <much-select> is hooked up to an API and options are being sprinkled in as the user searches for the options they want.

Custom Option Validation and Transforming

When a user adds a custom option, do we want to make an api for validating and transforming it.

For instance, say you want to use this as a tag, and are going to allow the user to create new tags, but the tags should be lower case and have - instead of spaces.

We could:

  • have some sort of a callback, where the user needs to validate and transform the user entered value
  • have some commonly used validations and transformation baked in and additional options would require extending the web component

We might need a separate validation step where we disable the "Add ..." option in the dropdown unless it passes a validation method. Again, we could have support for custom validation or baked in validation... or both.

Things that need to be finished before this is done...

  • Toggle the allow custom attribute flag while keeping the transformation and validation
  • When in dataset output mode only to the transformed value on blur
  • When in custom html output mode if an error message should be visible to for a custom option show the message in the description of the custom option. The custom option should also be disabled.

Events Only Mode

Add a boolean attribute called events-only="" which will ensure the much-select does not write to the light DOM and will rely on whatever is managing state to update the light DOM.

Initial values need to respect ordering in multi select mode

We have the following example, and it's not respecting the order of the selected-value.

<much-select multi-select="true" selected-value="Dory,Betta" selected-value-encoding="comma" allow-custom-options="true">
  <select slot="select-input">
    <option>Angelfish</option>
    <option>Betta</option>
    <option>Cod</option>
    <option>Dory</option>
    <option>Eulachon</option>
    <option>Fangtooth</option>
  </select>
</much-select>

Multi select arrow keys

If there's nothing in the filter field, using the arrow keys should move the course between the selected items.

Filtering should be more strict

Right now we are showing a bunch of partial matches.

We're doing this:
image

Maybe we should just be showing this:
image (1)

Perhaps we could configure this with an attribute.

Support for more DOM changes

There are several things I either know don't work, or probably don't work.

  • If there's a list of <option> in the slot="select-input" adding a selected attribute to one of them works, but removing a selected attribute does not.
  • Adding multiple selected= attributes should work in multi-select mode.

These are tricky because the default behavior now is to preserver the selected values. Maybe that behavior can be toggled with an attribute. ๐Ÿค” I don't really like that idea.

Accessability

There are a lot of ways we could make this more accessible. My current idea is to have a fallback rendering that can be triaged... somehow... that will render the widget, not as a single UI component but a set of native inputs.

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.