-
Notifications
You must be signed in to change notification settings - Fork 113
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
Comments
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 If you make the window vertically small enough that the 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. |
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 |
I'm also experiencing this issue. I've managed to make things a little better (but not quite perfect), by manually adjusting the Here's some sample pseudo-like code (not quite accurate, since the dropdown lives in widgets that are inside the # .....
let scrollable = scrollable(widget_list);
.on_scroll(|viewport| {
Message::Scroll(viewport)
});
# .....
match message {
Message::Scroll(viewport) => {
self.state.scroll_offset_y = viewport.absolute_offset().y;
}
}
let mut dropdown = build_dropdown();
dropdown = dropdown.offset(iced_aw::drop_down::Offset::from(-scroll_offset_y + 5.0)); With this workaround:
I have not figured out how to solve the latter. It's quite a bad usability issue, so despite half the trouble being worked-around here, dropdowns are still not usable in a scrollable. |
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.
The text was updated successfully, but these errors were encountered: