Comments (5)
Thats right multi select is not yet implemented. Data binding uses HTMLSelectElement.value
for the binding - which is the first selected value in case of a multi select (according to the spec).
I guess shelly
should be an array of the selected values, in your case. It needs to be reworked a bit to support this. I would ask if you are interested in submitting a PR, but currently setting up the project locally is pretty painful because of the modular nature (lots of repos) 😄. I plan to make things more community and PR friendly for the next release and i will squeeze in a fix for this too.
Thx for the issue, I will keep it open until the fix arrives!
from bind-middleware.
This works as a one way binding in the meantime, if that's enough for your use case:
const map = Array.prototype.map
nx.components.app()
.use((comp, state) => {
state.names = ['John', 'Ann', 'Joe']
state.onchange = (ev) => {
state.selected = map.call(ev.target.selectedOptions, option => option.value).join(', ')
}
}).register('my-app')
<my-app>
<select name="selected" multiple #change="onchange($event)">
<option value='John'>John</option>
<option value='Ann'>Ann</option>
<option value='Joe'>Joe</option>
</select>
<p>@{selected}</p>
</my-app>
from bind-middleware.
@jaypha I fixed it: nx-js/bindable-middleware@f3bb59f.
Now your example would set selly
to an array of values. Just run an npm i
to get the latest version (1.0.2) of the bindable middleware. I will wait to see if it works for you before closing this (:
from bind-middleware.
I just tested the new fix, and this appears to work fine. Thanks.
from bind-middleware.
Great! I am closing this issue then.
from bind-middleware.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bind-middleware.