-
Notifications
You must be signed in to change notification settings - Fork 839
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
EuiPortal should be able to use different portal target than document.body based on provided Context #7778
Comments
EuiWindowEvent would need same treatment too: It relies on hardcoded Meaning that only possible workaround for now is to fork the EUI and apply patches. |
Is this something you could resolve via https://eui.elastic.co/#/utilities/provider#component-defaults Regarding |
Unless it supports nested EuiProvider tags. Perhaps I'll create a PR for my proposal if I manage to get it working. (I'm the original issue author just using my private account) |
Ah gotcha, no, nested Edit: To clarify, based on the complexity of the PR, we may not accept it as this is very edge case for Elastic's use cases, but we would certainly review it. If it were a small, elegant, and safe enough change, that would certainly weigh us towards accepting it! |
What's the recommended way of using locally forked EUI repository? Currently my flow is:
On the client repo:
It works flawlessly however the |
Hi @prcdpr! We recommend There isn't a built-in script to build EUI in watch mode as a library (updating the
BABEL_MODULES=false NO_COREJS_POLYFILL=true yarn run babel --watch --out-dir=es --extensions .js,.ts,.tsx src
NO_COREJS_POLYFILL=true yarn run babel --watch --out-dir=lib --extensions .js,.ts,.tsx src Please note that these commands should be considered a quick and dirty fix to reduce recompilation/prevew time, and you should always run |
Watch recompilation commands work however I didn't manage to get it working with
|
Any chance to reopen #7782 ? theKashey/react-focus-on#96 Currently it works pretty well in my use case, I don't have any outstanding bugs remaining with the components I use. |
Is your feature request related to a problem? Please describe.
I'm trying to render EuiFlyouts inside the child window opened via
window.open
. Most of the things work except for Flyouts/Modals as they open in the parent window instead of child window.I use React portals to render into the child window (via my own
<ChildWindow>
component).Describe the solution you'd like
I'd like to do something like the following (pseudocode):
EuiDomWindowContextProvider
would be a new component that provideswindow
handle via React context to its children.Existing type
EuiPortal
, instead of using always thedocument.body
target as in https://github.com/elastic/eui/blob/main/packages/eui/src/components/portal/portal.tsx#L77 it would try to resolve the portal target using the provided value fromEuiDomWindowContextProvider
first.As fallback (no context provided) it would use
document.body
. This would make the change non-breaking.Describe alternatives you've considered
The only possible workaround right now, would be to disable
ownFocus
on EuiFlyout and wrap each flyout with custom portals and overlay masks.Desired timeline
This isn't the most frequent use case for most people but at the same moment is very easy to implement. It would unblock me with using EUI in multi-window Electron app.
The text was updated successfully, but these errors were encountered: