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

Drag into Mosaic #190

Open
Dagur opened this issue Jul 6, 2022 · 2 comments
Open

Drag into Mosaic #190

Dagur opened this issue Jul 6, 2022 · 2 comments

Comments

@Dagur
Copy link

Dagur commented Jul 6, 2022

Hi. I'm trying to implement dragging from outside Mosaic. I've done as you described here #122 (comment)
and it appears to work but the problem I have is that in endDrag my component.context doesn't have a mosaicActions object so I can't really do anything useful.
Can you give me any hints to tell me what I might be doing wrong?

@Wozniaxos
Copy link

Wozniaxos commented Jul 15, 2022

I think this is because of a lack of Mosaic context, I am currently working on decoupling Mosaic provider that will render just children and nothing more from Mosaic window renderer that you will be able to use it wherever you want. Something like this:

<Mosaic {...allMossaicProps}>
    <MyHeader />
    <MyButton />
    <MosaicWindows /> //You decide where to put it
</Mosaic>

Then we can hook in MyHeader and MyButton to the mosaic actions and do whatever we want to do. Currently there is no possibility to render juest a children in the Mosaic component

@nomcopter Have you thought about this, do you think there are any limitations?

@joshh101
Copy link

I would also love this feature because we are trying to implement mosaic with various components that require a preservation of context and state within them.

It is a major challenge to try and prevent the child component within a mosaic window from re-rendering unnecessarily when the layout changes.

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

3 participants