Comments (3)
Since maybe today this issue has gotten worse. Yesterday I was able to still click on items positioned on top of input fields as long as the input field wasn't already focused. Now it won't work at all.
I created a quick test case to re-produce my case with as little code as possible:
use floem::{
event::{Event, EventListener},
keyboard::{Key, NamedKey},
peniko::Color,
reactive::create_rw_signal,
style::{CursorStyle, Display, Position},
view::View,
views::{container, h_stack, label, Decorators},
widgets::text_input,
EventPropagation,
};
fn app_view() -> impl View {
let search_text = create_rw_signal(String::from(""));
let view = h_stack((
label(|| "Search:"),
text_input(search_text).style(|s| s.width_full().position(Position::Relative).z_index(4)),
container(label(|| "X"))
.on_click(move |_| {
println!("This is not clickable");
EventPropagation::Stop
})
.style(move |s| {
s.position(Position::Absolute)
.items_center()
.justify_center()
.height(30.0)
.width(30.0)
.display(Display::None)
.z_index(100)
.inset_top(0)
.inset_right(29)
.cursor(CursorStyle::Pointer)
.background(Color::rgb8(200, 20, 0))
.hover(|s| s.cursor(CursorStyle::Pointer))
.apply_if(!search_text.get().is_empty(), |s| s.display(Display::Flex))
}),
))
.style(|s| {
s.flex()
.items_center()
.justify_center()
.margin(10)
.width_full()
.height(30)
.gap(3.0, 0.0)
});
let id = view.id();
view.on_event_stop(EventListener::KeyUp, move |e| {
if let Event::KeyUp(e) = e {
if e.key.logical_key == Key::Named(NamedKey::F11) {
id.inspect();
}
}
})
}
fn main() {
floem::launch(app_view);
}
This will render the below:
Note that I seem to be unable to execute the click handler. I tried with on_click
and EventPropagation::Continue
as well as on_click_stop
.
from floem.
@Zoxc might have some feedback here. It seemed that there was a push to remove z-index entirely because z-index isn't supported in all renderers.
from floem.
It would require sorting to support all renderers and event handling. I don't think the complexity of that is justified.
from floem.
Related Issues (20)
- Need a way to create a Floem NSView in a foreign Mac OS app
- Absolute positioning layout widget for node graphs HOT 4
- in this trait function " fn paint(&mut self, cx: &mut crate::context::PaintCx) " why cx object has not any function to draw something. HOT 1
- docs: can we display GUI examples on the web? HOT 1
- checkbox doesn't fire `.on_click_stop` in example HOT 4
- Crash when opening inspector
- It's not implement at peniko::kurbo::PathSeg::Cubic(_)
- ime input at wrong position
- Element inspector is very CPU-hungry
- Panic when stopping an animation
- Sufficiently large virtual lists run into float inaccuracy issues
- Inserting text in the middle of a textbox is impossible HOT 3
- Radio buttons are broken HOT 1
- [docs] suggestion: explicity remark that signals cannot be used from other threads
- crash app when write app in Arabic HOT 3
- Use of unstable library feature 'lazy_cell' in /renderer/src/text/layout.rs HOT 5
- virtual_stack items don't fill height of virtual stack (macOS)
- build fails because of error in `floem_tiny_skia_renderer` HOT 3
- text-input unable to enter Chinese characters.
- Cursor doesn't appear over window when run in WSL 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 floem.