New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ux-select #19
Comments
We would really like to have au-select :) For a first pass, I wouldn't blend in anything related to auto-complete. I'd just work on the core component. One thing we'd love to be able to do is have the markup work like a normal select. So, ux-select would have ux-option elements inside them. Inside of each ux-option element would be the template for rendering out that option. Then you'd also be able to use repeat.for to generate options as well. If you are interested in working on this, then take a crack at it and submit a PR. We can work with you to get it into its final form. Let me us know! |
Sounds like a plan :) How about unit tests though? I'd like to unit test it but I don't see any existing tests in the |
We don't have any yet. I'd like to have some. We have our testing library to help out with that. There may be some challenges with using it with the new style system. I'm not sure. If you encounter those, let me know so we can look into it. |
Fair enough, I'll give it a shot. Do you have any objections against me adding a I'm working on it here: https://github.com/fkleuver/ux/tree/ux-select |
No objections :) |
It's not really possible to style a
Which is not supported by all browser/versions, I believe. Do you guys have any guidelines with respect to minimum browser support? Would it otherwise be an idea to have an opt-in |
JFI I'd like to note that MDL (v2) also provides an optional native select implementation. |
agreed. if there are other minimal browser requirements documented, rob can direct us to those. |
@Thanood I am currently using the select from http://materializecss.com/forms.html as a basis. It has a custom list by default and the option to use native select. Guess I'll stick to that for now? |
@fkleuver I'm indifferent about the Materialize approach since you basically need a css class (which is btw. working more as an identifier) to switch to basic default behaviour. Maybe there are better ways to achieve this. My personal ideal would be, when using the native version, just a css class which styles the native select to look a bit more like the current theme (maybe an attribute which adds some features). So, the other way around, sort of. 😃 |
@Thanood Yea that makes sense, it also keeps the first iteration simpler. Thanks for your suggestion :) |
One important feature is that we want to be able to provide an arbitrary template for the items in the list. That's something that can't be done with a native select. For accessibility we may need to have a hidden select internally which we populate with text versions of the templated items somehow. |
@EisenbergEffect Regarding the unit tests, I get this error when trying to configure the plugin from within unit tests:
If I skip plugin configuration altogether, pretty much everything works fine except the style bindings themselves. The generated classes are appended to Can this be related to the different versions in |
@EisenbergEffect Regarding the template for the items in the list, I thought about doing this with a wrapped I've worked around this before by wrapping the raw html in |
Maybe with viewCompiler and viewSlots. I've done this for a tree-view. It's not the best or anything but works and afaik it performs well. |
I'm away from my machine now but I can send you a basic sample of how to do
this tomorrow probably.
…On Nov 24, 2016 11:06 AM, "Daniel Bendel" ***@***.***> wrote:
Maybe with viewCompiler and viewSlots. I've done this for a tree-view.
It's not the best or anything but works and afaik it performs well.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAIBnZhZyGaSGjHmz23LB2t8N3FnhYnYks5rBeAZgaJpZM4K5--S>
.
|
I made this one before: https://github.com/fkleuver/aurelia-starter/blob/master/src/resources/elements/dynamic-html.ts Could use that one as-is like so: If it is (idk about the overhead of having to compile a custom element that encapsulates such logic), though, then wouldn't it be more useful to just add a component like that to EDIT |
here's a pure Aurelia autocomplete with the accessibility stuff working in case it helps with building the select element: |
That will certainly help, thanks! |
Here's a demo of the last commit: http://fkleuver.azurewebsites.net/#/selects What works
What's still missing
Any feedback is appreciated :) |
I'd like to see a markup like this work so it's closer to the native: <ux-select>
<ux-option repeat.for="item of items" model.bind="item">
<h5>${item.someProperty}</h5>
<div>${item.anotherProperty}</div>
</ux-option>
</ux-select> |
I like that concept too. We've worked extensively with Select2, Selectize, etc. Most client apps require additional information / markup for each option and this would accommodate that. |
I agree. I'm thinking I should get rid of the intermediate collection thing altogether, because it doesn't really make things easier the way I hoped it would. So having no default markup for the options (you always have to specify it) is OK? |
I do see some benefit with aligning the markup with the native select element but doing so sends us in a direction where we have to deal with synchronization with the repeat that will inevitably be used to render the select options. It also takes away our control over virtualization which will be huge in reducing the number of DOM elements (especially when there are multiple ux-selects on a page and they have complex item templates). I'm not sure yet what the pros/cons will be in terms of accessibility. I think I still prefer the "ItemsSource" approach where you bind the "items" data and optionally specify the template part for rendering the individual items. |
I have tried the native approach, but it creates other challenges. I could try to tackle those but I don't know if that will result in a "good" solution. An example, given this markup:
You get this result (removed attributes & comments for readability):
|
@EisenbergEffect I think I could do it your way if there is a reliable method to retain the bindingContext in which the items are declared, or merge it into |
@EisenbergEffect @jdanyow The more I think about it, the more I'm leaning towards a "html generator" approach. In other words: collect the information from the bindables and the slot's innerHTML (even allowing the user to set the raw HTML property directly, if they wish), and then just programmatically build up the right string of html and pass that to the compiler. The added flexibility opens up all sorts of possibilities and I don't see any issues with supporting the usage methods mentioned so far. Are there any factors I'm overseeing that make this a no-no, or shall I give it a shot? |
I'm open to anything just about. We can experiment and see what we think works best. Are you aware of the |
The one concern I have is the impact of rendering all the options out to the DOM, especially when the item-templates are complex or there are a lot of items. Off the cuff I'd bet on an approach that uses the template-part functionality and only renders the 10 or 15 options that are visible in the drop-down's view-port, only when the drop-down is open. This will be a potentially massive reduction in dom elements depending on the complexity of the template, number of options and number of selects on the form. There's an example of this here- minus the logic to only render the visible options. |
That's a good argument and it definitely supports the notion of having an items-source. Let's go with that. We don't necessarily need to use template parts though either. We could assume that the content of the ux-select is the template. Then we could use the processContent hook to extract it and compiler it into a view factory. It could even be auto-wrapped in a container element as part of that if desired. |
any update? |
Apologies for not following up, I've been very busy the past 8 months. I will continue working on this in the coming weeks. |
Issue moved to aurelia/ux-components #15 via ZenHub |
Edit: Actually using @fkleuver Let me know if you need any help continuing the element |
@bigopon is going to take over development for this. It is a pretty critical piece. |
Adding this to the 0.7.0 Milestone |
For accessibility, there are two options to implement select list:
|
I would think that it would depend. If the user is selecting only one item at a time, i.e. a standard select, If the user is allowed to select multiple attributes, i.e. If we choose only one, |
@bigopon It's worth looking here: https://github.com/EisenbergEffect/aurelia-composition-demo/tree/master/src/part-composition There are some ideas there on how to use parts for list item and selected item, including syntax enhancements and APIs for simple and advanced scenarios. It might provide a good staring point. It would need quite a bit of CSS, accessibility, etc. work though. |
I worked with both Aurelia and Materialize for a while now, and I'd love to help out with a component or two.
Recently I've made a sort of dropdownlist/autocomplete combo in Aurelia.
I'm doing something similar to what Materialize.js is doing, which discards the
select
and builds a custom list from scratch.It responds to different UI events like
arrow up
/down
(ormouse wheel
) for selecting items,enter
to pick an item,esc
to close it, and simply typing in it in order to filter the list.It may be doing too much for a single usercontrol, I just had fun creating it with Aurelia.
I'd like to try and make it fit in with the rest of the
ux
components.Example: https://github.com/fkleuver/aurelia-starter/tree/master/src/resources/elements/dropdownlist
I'm thinking about "cutting it in half", making a normal
select
and a normalautocomplete
component out of it.I didn't have the
ux
project in mind when I originally created it, so I will still need to make it look like this but I don't expect much trouble there: http://materializecss.com/dropdown.htmlWould something like this be functionally okay or is it preferable to stick to the native html
select
element?Any thoughts on which direction I should take this?
The text was updated successfully, but these errors were encountered: