Comments (10)
@JosephusPaye Not to rush but i could really use a select component in the coming week. going to use keen-ui on a product. :)
from keen-ui.
The behavior you are describing (where the text and value are synced separately) was removed when I rewrote the autocomplete in v0.8.6.
Now it only only auto-completes the user's input, therefore there is only one prop to watch, the value.
What you want is more like a select component, which I plan on adding soon.
from keen-ui.
I want a select too yes. But I use the auto complete to search for collections in the database like users. I want the users name to be displayed, but I want to submit the users ID.
from keen-ui.
In that case you could use the text (value) to find the ID if you have it in a suggestions array. This is how it was done in v0.8.5:
function findValue(text) {
// Just return the text if suggestions is an array of strings
if (this.suggestions[0] && typeof this.suggestions[0] === 'string') {
return text;
}
text = text.toLowerCase();
for (let i = 0; i < this.suggestions.length; i++) {
if (this.suggestions[i].text.toLowerCase() === text) {
return this.suggestions[i].value;
}
}
return null;
}
You can then run this function on submit to find the user ID. The new select component will have this functionality by default.
from keen-ui.
I'm not sure if we differentiate a select and an auto complete the same way?
For me a select has a preset range of values and don't have a search option
The auto complete has a dynamic set of values and they are found by searching
from keen-ui.
A select can also be dynamic and have search. Like, for example, Select2.
But a select doesn't allow the user to select a value that's not in the options, while an autocomplete allows for entering any text, even if it's not in the suggestions.
from keen-ui.
That's true.
Do you have an idea when you have it finished?
And thanks for the code, it fails if 2 users has the same name, but it will work for now.
from keen-ui.
Not sure, but I've already started work on it and it might be done by Friday.
from keen-ui.
Perfect :-)
from keen-ui.
A Select and Slider component just landed in v0.8.8.
from keen-ui.
Related Issues (20)
- Add `ui-textbox__input-wrapper` around `ui-textbox__input` and `ui-textbox__textarea` HOT 4
- DatePicker: When yearRange is specified with descending array, month selection is broken. HOT 3
- How to dismiss a UiSnackbarContainer? HOT 2
- Missing @types/keen-ui HOT 2
- Having a size undependand on the root node's font-size HOT 3
- position of UiDatepicker not correct when combined with UiPopover/UiMenu HOT 1
- How I get outlined share icon? HOT 3
- Support for autocapitalize property
- ESLint CRLF Windows HOT 6
- Question - Overriding variables.scss HOT 3
- how to add button or link in ui-collasible header HOT 2
- UiSelect not working in Modal HOT 1
- UiSelect selected template HOT 3
- autocomplete on custom case
- Vue.js 3.0 and further plans HOT 13
- UiCalender is not rendering HOT 1
- Dart Sass deprecation warnings HOT 1
- keen-ui.js:8252 [UiRippleInk]: Trigger element not found. HOT 1
- UiSelect can no longer be used correctly in UiPopover HOT 1
- Click on calendar buttons (without type argument) triggers form submit event HOT 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 keen-ui.