You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EuiPopover] Both hasShadow and hasBorder are ignored in panelProps #6832
Describe the bug
When giving hasShadow and/or hasBorder to the popover panel via the panelProps prop, you don't get the expected results. For example, when giving panelProps={{ hasShadow: false }} as a prop to EuiPopover...
Actual
Expected
Environment and versions
EUI version: 81.0.0
Browser: Chrome
To Reproduce
Steps to reproduce the behavior:
Create an EuiPopover component and add panelProps={{ hasShadow: false }} as a prop
Open the popover and notice that the shadow is still present 🔥
and/or...
Create an EuiPopover component and add panelProps={{ hasBorder: true }} as a prop
Open the popover and notice that the panel does not have a border 🔥
@ryankeairns can you chime in on whether this is a deliberate design decision? To be honest I would assume so as the contrast in the popover's visuals is insufficient otherwise.
FWIW I'm in favor of keeping the shadow. Removing it creates a non-text contrast failure where the light blue and white have a contrast ratio less than 3:1. I'm not 100% sure the shadow does either, but it's much clearer the differentiation between EuiPopover and the background.
Just for some context, I wanted to be able to add my own shadow so that I could try to match the styling of the popover used in the EuiDualRange component. Specifically, I wanted to both (1) hide the arrow for the popover and (2) not show the shadow at the top of the panel so that I could make my own EuiPopover to match the following:
IMO, it is a bit confusing that the popover component accepts hasShadow and hasBorder (which are both available via the EuiPanel component) if they are just going to be ignored :)
We would almost certainly Omit the shadow/border props for panelProps via TS rather than add support. Which we certainly can/should do (if Ryan confirms the intentionality of the design) - it's an oversight that we didn't exclude them in the first place.
Based on the example you've given, I would strongly suggest using EuiInputPopover rather than try to recreate EUI components from scratch. If you could describe the custom popover usage you're going for, we can help a little more (recommendations on CSS utilities/overrides) etc.
I am trying to fix some known a11y concerns with the range slider control - originally, I thought I could do this by switching over to the EuiDualRange component but, upon further investigation, this was not possible due to the following two reasons:
Notice in the following screenshot that (a) the current popover for the range slider has a title and (b) we added an erase icon that will clear the user’s selections:
Because the consumer doesn't have control over how the EuiDualRange popover looks, I unfortunately had no way of adding these two things.
You cannot add an arrow/anchor to the popover when using EuiDualRange - our options list control currently uses an arrow so ideally we would want the range slider to match:
To try to get around (2), I was exploring (very loosely) the idea of removing the arrow from the options list control and making the styling match the EuiDualRange popover - however, when trying to add my own styling, I caught the fact that hasShadow was being ignored and assumed it was a bug. If we did decide to go this route, I think you're right that using EuiInputPopover might be the right call.
However, because of (1) above, I am ultimately locked out of using EuiDualRange anyway - so I'm proceeding with using EuiFormControlLayoutDelimited instead for the range slider control ATM. So if you decide to simply omit hasShadow and hasBorder from panelProps that makes total sense to me as a fix!
Super interesting use case - thanks for diving into more detail!
To be honest, I would argue both the components listed should be using EuiInputPopover, since they're originating from inputs/form controls - neither should have an arrow displayed.
@ryankeairns I know the 2nd OS screenshot is a custom Kibana implementation of EuiSelectable - you've mentioned it several times now. I think we should consider bringing it back into EUI for more UI/UX consistency. Thoughts?
Apologies for the delayed reply. Now, I'll confirm and +1 where you all ended up :)
Yes, it was a design decision and yes we should have omitted these props for popovers.
+1 to not displaying arrows (i.e. instead, use EuiInputPopover) when opening from an input. Coincidentally, I ran into this in Kibana just yesterday and had a similar reaction - it looked and felt odd.
+1 to bringing those EuiSelectable enhancements into EUI. That idea was captured here and is awaiting triage.
Activity
cee-chen commentedon Jun 5, 2023
@ryankeairns can you chime in on whether this is a deliberate design decision? To be honest I would assume so as the contrast in the popover's visuals is insufficient otherwise.
1Copenut commentedon Jun 5, 2023
FWIW I'm in favor of keeping the shadow. Removing it creates a non-text contrast failure where the light blue and white have a contrast ratio less than 3:1. I'm not 100% sure the shadow does either, but it's much clearer the differentiation between
EuiPopoverand the background.SC 1.4.11: Non-text Contrast (Level AA)
Heenawter commentedon Jun 5, 2023
Just for some context, I wanted to be able to add my own shadow so that I could try to match the styling of the popover used in the
EuiDualRangecomponent. Specifically, I wanted to both (1) hide the arrow for the popover and (2) not show the shadow at the top of the panel so that I could make my ownEuiPopoverto match the following:IMO, it is a bit confusing that the popover component accepts
hasShadowandhasBorder(which are both available via theEuiPanelcomponent) if they are just going to be ignored :)cee-chen commentedon Jun 5, 2023
We would almost certainly
Omitthe shadow/border props forpanelPropsvia TS rather than add support. Which we certainly can/should do (if Ryan confirms the intentionality of the design) - it's an oversight that we didn't exclude them in the first place.Based on the example you've given, I would strongly suggest using
EuiInputPopoverrather than try to recreate EUI components from scratch. If you could describe the custom popover usage you're going for, we can help a little more (recommendations on CSS utilities/overrides) etc.Heenawter commentedon Jun 5, 2023
Well, it's a bit of a long story hahah :)
I am trying to fix some known a11y concerns with the range slider control - originally, I thought I could do this by switching over to the
EuiDualRangecomponent but, upon further investigation, this was not possible due to the following two reasons:Notice in the following screenshot that (a) the current popover for the range slider has a title and (b) we added an
eraseicon that will clear the user’s selections:Because the consumer doesn't have control over how the
EuiDualRangepopover looks, I unfortunately had no way of adding these two things.You cannot add an arrow/anchor to the popover when using
EuiDualRange- our options list control currently uses an arrow so ideally we would want the range slider to match:To try to get around (2), I was exploring (very loosely) the idea of removing the arrow from the options list control and making the styling match the
EuiDualRangepopover - however, when trying to add my own styling, I caught the fact thathasShadowwas being ignored and assumed it was a bug. If we did decide to go this route, I think you're right that usingEuiInputPopovermight be the right call.However, because of (1) above, I am ultimately locked out of using
EuiDualRangeanyway - so I'm proceeding with usingEuiFormControlLayoutDelimitedinstead for the range slider control ATM. So if you decide to simply omithasShadowandhasBorderfrompanelPropsthat makes total sense to me as a fix!cee-chen commentedon Jun 5, 2023
Super interesting use case - thanks for diving into more detail!
To be honest, I would argue both the components listed should be using
EuiInputPopover, since they're originating from inputs/form controls - neither should have an arrow displayed.@ryankeairns I know the 2nd OS screenshot is a custom Kibana implementation of
EuiSelectable- you've mentioned it several times now. I think we should consider bringing it back into EUI for more UI/UX consistency. Thoughts?ryankeairns commentedon Jun 7, 2023
Apologies for the delayed reply. Now, I'll confirm and +1 where you all ended up :)
Yes, it was a design decision and yes we should have omitted these props for popovers.
+1 to not displaying arrows (i.e. instead, use
EuiInputPopover) when opening from an input. Coincidentally, I ran into this in Kibana just yesterday and had a similar reaction - it looked and felt odd.+1 to bringing those
EuiSelectableenhancements into EUI. That idea was captured here and is awaiting triage.