Skip to content
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

Draggable sidebar example not working #700

Closed
sekoyo opened this issue Nov 24, 2024 · 1 comment · Fixed by #701
Closed

Draggable sidebar example not working #700

sekoyo opened this issue Nov 24, 2024 · 1 comment · Fixed by #701

Comments

@sekoyo
Copy link

sekoyo commented Nov 24, 2024

Hi,

Has this example regressed? When I hover I see no border to drag:

Screen.Recording.2024-11-24.at.17.29.45.mov

If I change this to red .border_color(Color::rgb8(255, 0, 0)) I can see it, but can't drag it:

let dragger = label(|| "")
        .style(move |s| {
            s.position(Position::Absolute)
                .z_index(10)
                .inset_top(0)
                .inset_bottom(0)
                .inset_left(sidebar_width.get())
                .width(10)
                .border_left(1)
                .border_color(Color::rgb8(255, 0, 0))
                .hover(|s| {
                    s.border_left(2)
                        .border_color(Color::rgb8(41, 98, 218))
                        .cursor(CursorStyle::ColResize)
                })
                .apply_if(is_sidebar_dragging.get(), |s| {
                    s.border_left(2).border_color(Color::rgb8(41, 98, 218))
                })
        })
        .draggable()
        .dragging_style(|s| s.border_color(Color::RED))

Screenshot 2024-11-24 at 17 34 22

jrmoulton added a commit to jrmoulton/floem that referenced this issue Nov 27, 2024
@jrmoulton
Copy link
Collaborator

Yes. This was a regression. This broke because we made it so that if there are overlapping elements, if the element on top doesn't handle the event, the event isn't passed to the next item. A simple fix is just moving the dragger to be the last item in the stack so that it is considered "on top". That is what I have done in #701

jrmoulton added a commit to jrmoulton/floem that referenced this issue Nov 27, 2024
jrmoulton added a commit that referenced this issue Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants