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

EuiPanel shows shadow when hasShadow set to false when there is an onClick property set #8007

Closed
ray-holland-es opened this issue Sep 5, 2024 · 2 comments
Labels
bug ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible

Comments

@ray-holland-es
Copy link

Describe the bug
When the hasShadow property is set to false, it is incorrectly rendering a shadow when focusing the panel (when there is a onClick set to the EuiPanel).

Impact and severity
Low severity

Environment and versions

  • EUI version: 87.2.0
  • React version: 17.0.2
  • Browser: Chrome 127.0.6533.120
  • Operating System: MacOS 14.6.1

To Reproduce
Steps to reproduce the behavior:

<EuiPanel
	hasShadow={false}
	hasBorder
	onClick={() => {}}
>
        Hello World
</EuiPanel>

Expected behavior
When hovering or clicking a panel with hasShadow set to false, it should not show a shadow.

Minimum reproducible sandbox
https://codesandbox.io/p/sandbox/epic-kare-xmgpc2?workspaceId=acf84c92-4ee0-41b7-8d85-5c8d5bf54163

Screenshots

Image

@ray-holland-es ray-holland-es added bug ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible labels Sep 5, 2024
@ray-holland-es ray-holland-es changed the title EuiPanel shows shadow when hasShadow set to false when there is an onCilck property set EuiPanel shows shadow when hasShadow set to false when there is an onClick property set Sep 5, 2024
@cee-chen
Copy link
Member

cee-chen commented Sep 9, 2024

@MichaelMarcialis Can you respond to this? It looks to me like an intentional design decision based on the styles we're applying to clickable panels.

@MichaelMarcialis
Copy link
Contributor

Thanks for the ping, @cee-chen. And thanks for opening this issue, @ray-holland-es. The addition of the box-shadow styles on hover and focus of an EuiPanel component with an onClick prop is intentional and not one that we currently plan to change. This is designed to give users visual affordance that clicking the panel will perform an action.

Assuming you're attempting to create an interface like your example screenshot above (without the shadow on hover/focus) and you're currently using a combination of EuiPanel and EuiRadio, perhaps switching to EuiCheckableCard component would be a better fit? It does not utilize shadows for its hover/focus styles. See example in EUI docs: https://eui.elastic.co/#/display/card#checkable

For now though, I'm going to go ahead and close this out, as EuiPanel is operating as intended. Thanks!

@cee-chen cee-chen closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible
Projects
None yet
Development

No branches or pull requests

3 participants