Comments (4)
Widgets in Floem are highly composable. The current dropdown widget is built to not lock you into any required style. If it was any simpler there would be aspects of the widget that you couldn't control.
It might be a slight inconvenience to dial in the dropdown view just the way you want for a small project but once you've done it once you can just move that implementation to it's own function and reuse it. This is very practical even for small-medium projects.
An opinionated widget would awesome but that sort of thing belongs in a separate widgets/components crate that provides a consistent look across all widgets and can build on the un-opinionated widgets that Floem provides.
We also could provide our own opinionated widget but it wouldn't replace the un-opinionated one.
from floem.
for example the user code is required to provide a chevron icon for it?
It's not required, as the directory name should suggest, it's an example, list works fine without an icon.
and implement the default look manually?
I'm unsure what do you refer to as default look (since the links you gave point only to the example code file), below example works just as fine and isn't complicated
pub fn dropdown_view() -> impl View {
let show_dropdown = create_rw_signal(false);
form::form({
(form_item("Dropdown".to_string(), 120.0, move || {
dropdown(
move || Values::Three,
move |item| label(move || item).any(),
Values::iter(),
|item| label(move || item).any(),
)
.show_list(move || show_dropdown.get())
.on_accept(move |_val| show_dropdown.set(false))
}),)
})
}
from floem.
Sorry guys closing the issue now, I didn't realize you can use simpler code than the one in the examples to create it, thank you for your awesome work on floem :)
from floem.
Thanks and now worries. Happy you're enjoying :)
from floem.
Related Issues (20)
- [Editor] The Caret changes width depending if it's on a new line or has text
- [Editor] Moving focus out of the editor with keyboard alone
- [Editor] Event functions are not called on the editor HOT 2
- Editor selection no longer shows selection on empty lines
- Editor rwsignal HOT 1
- Border radius is ignored when border is set individually HOT 2
- Global shortcuts on the main view does not work for Linux platform
- Tooltips not hiding automatically on some cases
- Left sidebar layout example is missing the last element HOT 1
- VirtualList: multiple items are selected at the same time when inserting new elements
- Counter example doesn't compile HOT 1
- KeyUp event not triggered HOT 2
- App crashes when quitting while a tooltip is still visible HOT 2
- Signal on_cleanup not triggered HOT 1
- Conditional renderer compilation
- Unresolved imports in Counter example HOT 2
- Commit *Revert back to use CENTRAL_UPDATE_MESSAGES* breaks popups HOT 4
- Documentation for many methods of `View` refer to a non-existent method HOT 1
- Inter-window messages sent to a view via `ViewId.update_state()` are broken HOT 7
- Chaos when a new window is opened during a drag operation HOT 1
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 floem.