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

DropDown out of view if item is in scrollable #300

Open
JL710 opened this issue Nov 10, 2024 · 2 comments
Open

DropDown out of view if item is in scrollable #300

JL710 opened this issue Nov 10, 2024 · 2 comments

Comments

@JL710
Copy link

JL710 commented Nov 10, 2024

I displayed some stuff in a scrollable. I added a dropdown for each item in the list that adds the option to do edits. It opens a dropdown left next to the item.

It works fine if the item is always visible. But if it is a item that I first need to scroll to, the popup is at first visible and for each item it gets further down until it is invisible.

I do not have a minimal code example at the moment.

@JL710
Copy link
Author

JL710 commented Nov 30, 2024

I got some test code together:

#[derive(Debug, Clone)]
enum Message {}

#[derive(Default)]
struct App {}

impl App {
    fn update(&mut self, message: Message) -> iced::Task<Message> {
        iced::Task::none()
    }

    fn view(&self) -> iced::Element<Message> {
        iced::widget::scrollable(
            iced::widget::column![
                "a\na\na\na\na\na\na\na\nasd",
                iced_aw::widgets::DropDown::new("underlay", "overlay", true),
                "a\na\na\na\na\na\na\na\n"
            ]
            .width(iced::Fill),
        )
        .into()
    }
}

fn main() {
    iced::run("Test", App::update, App::view).unwrap();
}

You can reproduce it when you scale the window vertically. If you make it smaller then the content of the column and you scroll the overlay stays at the original place but the underlay moves.

If you make the window vertically small enough that the overlay disappears, you can still view the overlay when scrolling but the underlay stays invisible.

I think the issue relies in the dropdown not being aware of the position on the screen but only the one in the large scrollable area.

@genusistimelord
Copy link
Collaborator

ahh yeah, probably need to figure out how to add in the offsets of scrolling. IF you want to try and Tackle the issue We accept PR's

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

No branches or pull requests

2 participants