Skip to content

[EuiPopover] Fix filter drop-shadow bug#6604

Merged
elizabetdev merged 7 commits intoelastic:mainfrom
elizabetdev:fix-filter-drop-shadow-safari-bug
Feb 16, 2023
Merged

[EuiPopover] Fix filter drop-shadow bug#6604
elizabetdev merged 7 commits intoelastic:mainfrom
elizabetdev:fix-filter-drop-shadow-safari-bug

Conversation

@elizabetdev
Copy link
Copy Markdown
Contributor

@elizabetdev elizabetdev commented Feb 15, 2023

Summary

This PR fixes a bug in Safari where multiple filter drop-shadow were causing inner shadows inside the EuiPopover. Closes #6593.

This PR is blocked by #6603.

Screenshots from Safari

image

Tried to recreate old shadow with only one drop-shadow

image

New example added

This new example represents the data view picker in UnifiedSearch (elastic/kibana#151123). The example can be found in http://localhost:8030/#/navigation/context-menu#displaying-custom-elements

image

QA

How to test? Compare an old example with the new one in Safari:

Click Composers:

Click on Tag:

Test the new example that represents the use case from UnifiedSearch:

General checklist

  • Checked in both light and dark modes
    - [ ] Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
    - [ ] Props have proper autodocs (using @default if default values are missing) and playground toggles
    - [ ] Added documentation
    - [ ] Checked Code Sandbox works for any docs examples
    - [ ] Added or updated jest and cypress tests
    - [ ] Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
    - [ ] Updated the Figma library counterpart
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6604/

Copy link
Copy Markdown
Contributor

@daveyholler daveyholler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visually, looks good in Safari.

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6604/

@cee-chen
Copy link
Copy Markdown
Contributor

cee-chen commented Feb 15, 2023

Tried to recreate old shadow with only one drop-shadow

I really appreciated this side by side comparison, thanks for going above and beyond with it Elizabet!

New example added

Can you explain really quickly why the new example was added as part of this fix? It's not totally clear to me (as the issue was already reproducible in our existing docs).

In general I'd prefer we not add (potentially) unrelated changes in the same PR as fixes. If, for whatever reason, this fix needs to be rolled back, this additional doc example may not need to be rolled back with it - so if it's separate, we should include it in a separate PR.

Comment on lines +65 to +68
];

if (property === 'filter') {
return `filter: ${array.reduce((v, i) => `${v} drop-shadow(${i})`, '')};`;
// To prevent Safari from rendering multiple weird shadows we can only use one drop-shadow
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't even seem to find a documented bug report for this anywhere on the internet, so there's no issue we can track to restore previous functionality if Safari ever gets its shit together 🥲 Ah well, it do be that way sometimes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cee-chen it's even difficult to find examples on the internet with multiple filter drop-shadow(). My guess is that these shadows were copied and pasted from Figma:

Screenshot 2023-02-15 at 20 46 39

IMO if we can visually achieve the same without multiple drop-shadow the performance will be better. So even if this is fixed in Safari, I don't think we should restore it.

Copy link
Copy Markdown
Contributor

@cee-chen cee-chen Feb 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! I really like the point you made about performance. In that case, should we update the comment to reflect that, and maybe also move the const array = (or remove it entirely) since it only lives in the box-shadow CSS?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I also personally kinda wonder if the multiple box-shadows even add all that much or if we should consider paring them down to just 1 as well...

Copy link
Copy Markdown
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this as-is once rebased against latest main - my previous comment was primarily one of best practices, but it's not a blocking comment in the least.

Awesome work on this Elizabet - this is a super elegant solution with minimal to no tradeoffs 👏

@elizabetdev
Copy link
Copy Markdown
Contributor Author

elizabetdev commented Feb 15, 2023

Can you explain really quickly why the new example was added as part of this fix? It's not totally clear to me (as the issue was already reproducible in our existing docs)

@cee-chen all the reproducible examples in our docs are popovers with a selectable inside. But the UnifiedSearch example from Kibana is a popover with a EuiContextMenuPanel with custom content inside. So I decided to make something similar just to make sure the fix was really working.

Then I noticed that the custom example in the context menu page was very poor. All the other examples are real-world examples except this one:

Screenshot 2023-02-15 at 20 48 12

So I just replaced it with the example that I was using for testing.

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6604/

elizabetdev and others added 3 commits February 16, 2023 13:05
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
@elizabetdev elizabetdev enabled auto-merge (squash) February 16, 2023 13:46
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6604/

@elizabetdev elizabetdev merged commit 8cf4d8f into elastic:main Feb 16, 2023
breehall added a commit to elastic/kibana that referenced this pull request Feb 27, 2023
## Summary
EUI `75.1.1` ➡️ `75.1.2`

## [`75.1.2`](https://github.com/elastic/eui/tree/v75.1.2)

**Bug fixes**

- Fixed bug in `EuiPopover` where multiple filter `drop-shadow()` were
causing inner shadows in Safari
([#6604](elastic/eui#6604))
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this pull request Mar 10, 2023
## Summary
EUI `75.1.1` ➡️ `75.1.2`

## [`75.1.2`](https://github.com/elastic/eui/tree/v75.1.2)

**Bug fixes**

- Fixed bug in `EuiPopover` where multiple filter `drop-shadow()` were
causing inner shadows in Safari
([elastic#6604](elastic/eui#6604))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiSearchBar] Tags menu has an extra shadow in the dropdown on MacOS Safari

4 participants