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

Add EuiWindowProvider for multi-window support #7782

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

stil
Copy link

@stil stil commented May 22, 2024

Summary

Closes #7778

The main idea in this PR is to enable multi-windowed React development with EUI, for example in Electron.
The change is purely bug-fixing and does not introduce any UI changes.

I want to enable multi-windowed support by using React Portals to render into different DOM windows.
The problem is that, in many places, EUI operates on global window or document object which I aim to fix.

It's not a completely novel idea, something similar can be found in FluentUI: https://github.com/microsoft/fluentui/tree/master/packages/react-window-provider

New <EuiWindowProvider> component is exposing current window object for its children elements.

I'm marking it as draft so early-on you can have a look what's inside and perhaps immediately tell that it's not going to be merged, then I'll continue work internally.

The change is completely backwards compatible and does not introduce any behavior or UI changes.

Remaining work:

The most important is that with these changes Flyouts work in child windows!

Let me know wheter this is something you'd consider at all for merging (assuming that all potential issues with PR are fixed).

QA

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)
  • Designer checklist
    • Updated the Figma library counterpart

Copy link

cla-checker-service bot commented May 22, 2024

❌ Author of the following commits did not sign a Contributor Agreement:
c303002, 77f5704, 7d1d391, cf06fb6, 4fb655c, 26433d0, 0bf4e8e, c0b29cf, 96f438a, 6555c1a, cfbedf2, a46fea6, 99ed11c, 2d39642, 4ce72c6, a9a2388, 6ec4cf0, d90a8b5, 8fcf539, adf4ca7, 3f5a871, 11b93e4, cdffdc8, 0d48da6, 9e7faeb, af610db, 69f3c93, 41e633c, 3b73f6c, ba42379

Please, read and sign the above mentioned agreement if you want to contribute to this project

Copy link

👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually?

Copy link

👋 Hey there. This PR hasn't had any activity for 90 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

Copy link

❌ We're automatically closing this PR due to lack of activity. Please comment if you feel this was done in error.

@stil
Copy link
Author

stil commented Sep 24, 2024

Please reopen - I'm still working on fixes and now it's in better state than before with many bugs fixed.

@cee-chen
Copy link
Member

Re-opening! Apologies @stil, we hadn't even realized this PR was in the queue - we don't get automatically pinged/notified for draft PRs unless they open.

@cee-chen cee-chen reopened this Sep 24, 2024
Copy link

👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually?

@cee-chen
Copy link
Member

buildkite test this

@cee-chen
Copy link
Member

As a heads up you will need to sign the Elastic CLA with the email address associated with the git commits (use git log to see that email address).

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EuiPortal should be able to use different portal target than document.body based on provided Context
3 participants