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

PickLists don't work when inside a Button #763

Closed
thenlevy opened this issue Mar 5, 2021 · 0 comments · Fixed by #764
Closed

PickLists don't work when inside a Button #763

thenlevy opened this issue Mar 5, 2021 · 0 comments · Fixed by #764
Labels
question Further information is requested

Comments

@thenlevy
Copy link
Contributor

thenlevy commented Mar 5, 2021

When put inside of a Button, a PickList does't seem to receive user's input.

I modified examples/pick_list/src/main.rs by changing the view function:

   // One also needs to add a button::State attribute to `Example` to make this code compile
    fn view(&mut self) -> Element<Message> {
        let pick_list = PickList::new(
            &mut self.pick_list,
            &Language::ALL[..],
            Some(self.selected_language),
            Message::LanguageSelected,
        );

        let row = Row::new().push(pick_list).push(Text::new("A button containing a pick list"));

        let mut content = Scrollable::new(&mut self.scroll)
            .width(Length::Fill)
            .align_items(Align::Center)
            .spacing(10)
            .push(Space::with_height(Length::Units(600)))
            .push(Text::new("Which is your favorite language?"))
            .push(Button::new(&mut self.button, row));

        content = content.push(Space::with_height(Length::Units(600)));

        Container::new(content)
            .width(Length::Fill)
            .height(Length::Fill)
            .center_x()
            .center_y()
            .into()
    }

The Pick List is displayed inside the button but it is not possible to interact with it.
Eddit: Here is a gif showing the problem, I'm clicking of the picklist but nothing happens
no_interaction

@hecrj hecrj added the question Further information is requested label Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants