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

Operations Broken in Responsive #1534

Closed
2 tasks done
rs017991 opened this issue Nov 13, 2022 · 0 comments · Fixed by #1615
Closed
2 tasks done

Operations Broken in Responsive #1534

rs017991 opened this issue Nov 13, 2022 · 0 comments · Fixed by #1615
Labels
bug Something isn't working

Comments

@rs017991
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

When the target of an Operation lies anywhere within a Responsive, the operation is silently ignored.

You can reproduce the issue by running this modified example.
(after adding the responsive wrapper, the 'Scroll to top/bottom' buttons no longer function)

As with PaneGrid, Responsive is missing its operate method.

So I thought perhaps I could fix it in the same way, but was sadly unable to get it working after a bit of poking/prodding.

This is as far as I got writing an operate implementation for Responsive:

    fn operate(
        &self,
        tree: &mut Tree,
        layout: Layout<'_>,
        operation: &mut dyn Operation<Message>
    ) {
        let state = tree.state.downcast_mut::<State>();

        self.content.borrow().element.as_widget().operate(
            &mut state.tree.borrow_mut(),
            layout,
            operation,
        )
    }

This seemed to have no effect.
I do see that other methods in Responsive do a bit of a dance when working with its contents (mainly resolve).
That could be the missing piece, but I can't call it here because operate does not have a Renderer.

What is the expected behavior?

Operations should work within Responsive Elements

Version

master

Operative System

Windows

Do you have any log output?

No response

@rs017991 rs017991 added the bug Something isn't working label Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant