Skip to content

EuiGlobalToastList became hidden behind EuiFlyout with EUI 7.14.1 #5169

Closed

Description

@btychon

We have a seasoned Kibana plugin which makes extensive use of EUI Toast Messages to describe success/errors. Typically we use Flyouts for create/edit table records. Everything has worked fine up until 7.14.1.

This is not a problem that can be solved through CSS (i.e. Z-Index). For some reason the EuiFlyout was moved outside of the Kibana App wrapper with the recent upgrade.

This can't happen.

<div id="kibana-body">
  <div class="kbnAppWrapper">
    <div id="app-fixed-viewport"></div>
      <div class="kbnAppWrapper">
        <div class="euiPage>
          <div class="euiGlobalToastList">
<div class="euiFlyout position: static;">

If the EuiFlyout can't be moved back inside (like it used to), then the EuiGlobalToastList must be moved outside in order to supersede the iron-clad DOM hierarchy.

Activity

  1. thompsongl commented on Sep 13, 2021

    @thompsongl
    Contributor

    Hey @btychon
    EuiFlyout was intentionally moved outside of the normal document flow using React portals, but there should be no adverse stacking effects given normal usage of EuiGlobalToastList. See the simple reproduction in codesandbox that shows z-index working as expected.
    Do you have custom styles that change the default positioning of either component?

  2. added
    ⚠️ needs validation
    on Sep 13, 2021
  3. cchaos commented on Sep 13, 2021

    @cchaos
    Contributor

    I can also confirm that in Kibana specifically, that when using their global toast service, it does sit on top of any portalled flyouts.
    Screen Shot 2021-09-08 at 15 00 26 PM

    You should be using Kibana's notifications service as a Kibana plugin otherwise you will need to wrap your instance in an EuiPortal.

  4. cchaos commented on Sep 13, 2021

    @cchaos
    Contributor

    In EUI, we may want to consider adding this (EuiPortal) directly to the EuiGlobalToastList component with the option to disable it.

  5. btychon commented on Sep 22, 2021

    @btychon
    Author

    Wrapping the <EuiGlobalToast> list within an <EuiPortal> was a simple fix that's backwards/forward compatible with older ELK stacks in the wild. We built a notification API at the top level of the React app (also using the Context API) which basically works the same as the Kibana Notification Service. I think that was added in 7.10.x.

    I see the wisdom in moving fixed elements outside of the component hierarchy... glad I know about the <EuiPortal> now. I agree with cchaos's last comment. The <EuiGlobalToastList> should probably wrap its children in a portal by default. Anyway, thank you very much for the help!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚠️ needs validation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions