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

fix(overlay): set overlay display flex so children render correctly #4969

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

caseyisonit
Copy link
Collaborator

@caseyisonit caseyisonit commented Dec 2, 2024

Description

Overlay needs a display: flex applied so that the children render correctly when they overflow the view height and can scroll.

Resolves overflow and scrolling issues on Firefox and Safari for the following components:

  • Overlay
  • Combobox
  • ActionMenu
  • Menu
  • Menu with Submenu
  • Picker

Related issue(s)

Motivation and context

This allows users on Firefox and Safari to scroll and access all children in an overlay

How has this been tested?

  • Test case 1

    1. In Firefox open each component listed above in storybook
    2. Make the viewport short
    3. Content within should scroll and the container should be within the margins
  • Test case 2

    1. In Safari open each component listed above in storybook
    2. Make the viewport short
    3. Content within should scroll and the container should be within the margins
  • Test case 3

    1. In Chrome open each component listed above in storybook
    2. Make the viewport short
    3. Content within should scroll and the container should be within the margins
  • Did it pass in Desktop?

  • Did it pass in Mobile?

  • Did it pass in iPad?

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

Best practices

This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.

@caseyisonit caseyisonit requested a review from a team as a code owner December 2, 2024 23:08
Copy link

changeset-bot bot commented Dec 2, 2024

⚠️ No Changeset found

Latest commit: cc19c08

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

github-actions bot commented Dec 2, 2024

Branch preview

Review the following VRT differences

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@coveralls
Copy link
Collaborator

coveralls commented Dec 2, 2024

Pull Request Test Coverage Report for Build 12150906883

Details

  • 305 of 306 (99.67%) changed or added relevant lines in 1 file are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.004%) to 98.195%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/overlay/src/Overlay.ts 305 306 99.67%
Files with Coverage Reduction New Missed Lines %
packages/overlay/src/Overlay.ts 3 97.97%
Totals Coverage Status
Change from base Build 12079841155: 0.004%
Covered Lines: 32655
Relevant Lines: 33078

💛 - Coveralls

Copy link

github-actions bot commented Dec 2, 2024

Lighthouse scores

Category Latest (report) Main (report) Branch (report)
Performance 0.97 0.99 0.98
Accessibility 1 1 1
Best Practices 1 1 1
SEO 1 0.92 0.92
PWA 1 1 1
What is this?

Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on main ("Main"). Higher scores are better, but note that the SEO scores on Netlify URLs are artifically constrained to 0.92.

Transfer Size

Category Latest Main Branch
Total 250.792 kB 236.357 kB 🏆 236.873 kB
Scripts 60.821 kB 54.05 kB 🏆 54.335 kB
Stylesheet 53.779 kB 47.876 kB 🏆 48.078 kB
Document 6.223 kB 5.463 kB 🏆 5.471 kB
Font 126.998 kB 126.615 kB 🏆 126.641 kB

Request Count

Category Latest Main Branch
Total 52 52 52
Scripts 41 41 41
Stylesheet 5 5 5
Document 1 1 1
Font 2 2 2

Copy link

github-actions bot commented Dec 3, 2024

Tachometer results

Chrome

action-bar permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 739 kB 53.95ms - 54.90ms - faster ✔
5% - 8%
2.58ms - 4.98ms
branch 716 kB 57.10ms - 59.30ms slower ❌
5% - 9%
2.58ms - 4.98ms
-

action-menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 959 kB 143.35ms - 146.36ms - faster ✔
3% - 6%
4.22ms - 8.78ms
branch 918 kB 149.65ms - 153.07ms slower ❌
3% - 6%
4.22ms - 8.78ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 917 kB 71.99ms - 73.30ms - faster ✔
5% - 7%
3.65ms - 5.67ms
branch 875 kB 76.54ms - 78.07ms slower ❌
5% - 8%
3.65ms - 5.67ms
-

test-lazy permalink

Version Bytes Avg Time vs remote vs branch
npm latest 916 kB 70.03ms - 70.95ms - faster ✔
6% - 9%
4.74ms - 6.71ms
branch 874 kB 75.34ms - 77.08ms slower ❌
7% - 10%
4.74ms - 6.71ms
-

test-open-close-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 1.09 MB 1874.79ms - 1877.98ms - unsure 🔍
-0% - +0%
-2.89ms - +1.32ms
branch 1.05 MB 1875.80ms - 1878.53ms unsure 🔍
-0% - +0%
-1.32ms - +2.89ms
-

test-open-close permalink

Version Bytes Avg Time vs remote vs branch
npm latest 1.09 MB 1879.38ms - 1882.42ms - unsure 🔍
-0% - +0%
-2.81ms - +1.46ms
branch 1.05 MB 1880.08ms - 1883.08ms unsure 🔍
-0% - +0%
-1.46ms - +2.81ms
-

breadcrumbs permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 979 kB 520.66ms - 525.71ms - faster ✔
2% - 4%
12.70ms - 19.90ms
branch 937 kB 536.92ms - 542.05ms slower ❌
2% - 4%
12.70ms - 19.90ms
-

combobox permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 1 MB 41.88ms - 42.44ms - faster ✔
3% - 5%
1.28ms - 2.18ms
branch 959 kB 43.54ms - 44.24ms slower ❌
3% - 5%
1.28ms - 2.18ms
-

light-dom-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 1 MB 395.79ms - 400.42ms - faster ✔
1% - 3%
5.21ms - 13.20ms
branch 959 kB 404.05ms - 410.56ms slower ❌
1% - 3%
5.21ms - 13.20ms
-

contextual-help permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 944 kB 54.63ms - 56.23ms - faster ✔
6% - 10%
3.60ms - 5.80ms
branch 899 kB 59.39ms - 60.89ms slower ❌
6% - 11%
3.60ms - 5.80ms
-

menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 741 kB 217.32ms - 220.31ms - faster ✔
1% - 3%
2.93ms - 7.16ms
branch 718 kB 222.36ms - 225.35ms slower ❌
1% - 3%
2.93ms - 7.16ms
-

overlay permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 982 kB 433.43ms - 436.98ms - faster ✔
0% - 2%
2.12ms - 6.84ms
branch 940 kB 438.13ms - 441.24ms slower ❌
0% - 2%
2.12ms - 6.84ms
-

directive-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 1.06 MB 26.54ms - 27.09ms - faster ✔
5% - 8%
1.55ms - 2.37ms
branch 1.02 MB 28.47ms - 29.08ms slower ❌
6% - 9%
1.55ms - 2.37ms
-

element-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 1.05 MB 354.27ms - 357.64ms - faster ✔
3% - 4%
10.59ms - 15.32ms
branch 1.01 MB 367.24ms - 370.57ms slower ❌
3% - 4%
10.59ms - 15.32ms
-

lazy-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 851 kB 44.69ms - 45.71ms - faster ✔
6% - 9%
3.03ms - 4.46ms
branch 806 kB 48.44ms - 49.45ms slower ❌
7% - 10%
3.03ms - 4.46ms
-

picker permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 817 kB 509.39ms - 515.45ms - faster ✔
4% - 6%
20.58ms - 32.49ms
branch 776 kB 533.82ms - 544.08ms slower ❌
4% - 6%
20.58ms - 32.49ms
-

popover permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 817 kB 107.67ms - 108.93ms - faster ✔
1% - 4%
1.11ms - 4.73ms
branch 775 kB 109.53ms - 112.92ms slower ❌
1% - 4%
1.11ms - 4.73ms
-

tooltip permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 874 kB 36.09ms - 36.85ms - faster ✔
2% - 5%
0.78ms - 1.77ms
branch 832 kB 37.43ms - 38.06ms slower ❌
2% - 5%
0.78ms - 1.77ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 831 kB 25.36ms - 25.87ms - faster ✔
8% - 11%
2.30ms - 3.07ms
branch 789 kB 28.01ms - 28.59ms slower ❌
9% - 12%
2.30ms - 3.07ms
-

test-element permalink

Version Bytes Avg Time vs remote vs branch
npm latest 956 kB 53.86ms - 54.88ms - faster ✔
4% - 6%
2.20ms - 3.60ms
branch 912 kB 56.79ms - 57.74ms slower ❌
4% - 7%
2.20ms - 3.60ms
-

test-lazy permalink

Version Bytes Avg Time vs remote vs branch
npm latest 932 kB 44.33ms - 45.26ms - faster ✔
6% - 9%
2.74ms - 4.27ms
branch 887 kB 47.69ms - 48.91ms slower ❌
6% - 10%
2.74ms - 4.27ms
-

truncated permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 789 kB 62.66ms - 63.88ms - faster ✔
2% - 5%
1.44ms - 3.36ms
branch 763 kB 64.93ms - 66.41ms slower ❌
2% - 5%
1.44ms - 3.36ms
-
Firefox

action-bar permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 739 kB 121.15ms - 128.69ms - faster ✔
1% - 9%
1.39ms - 12.65ms
branch 716 kB 127.77ms - 136.11ms slower ❌
1% - 10%
1.39ms - 12.65ms
-

action-menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 959 kB 288.91ms - 292.89ms - faster ✔
16% - 18%
55.31ms - 63.25ms
branch 918 kB 346.75ms - 353.61ms slower ❌
19% - 22%
55.31ms - 63.25ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 917 kB 159.19ms - 164.49ms - slower ❌
1% - 7%
1.95ms - 10.93ms
branch 875 kB 151.78ms - 159.02ms faster ✔
1% - 7%
1.95ms - 10.93ms
-

test-lazy permalink

Version Bytes Avg Time vs remote vs branch
npm latest 916 kB 141.83ms - 147.69ms - unsure 🔍
-5% - +1%
-7.80ms - +1.44ms
branch 874 kB 144.37ms - 151.51ms unsure 🔍
-1% - +5%
-1.44ms - +7.80ms
-

test-open-close-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 1.09 MB 1896.48ms - 1901.40ms - faster ✔
0% - 1%
2.03ms - 11.89ms
branch 1.05 MB 1901.63ms - 1910.17ms slower ❌
0% - 1%
2.03ms - 11.89ms
-

test-open-close permalink

Version Bytes Avg Time vs remote vs branch
npm latest 1.09 MB 1900.22ms - 1905.22ms - faster ✔
0% - 1%
6.74ms - 15.42ms
branch 1.05 MB 1910.25ms - 1917.35ms slower ❌
0% - 1%
6.74ms - 15.42ms
-

breadcrumbs permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 979 kB 842.70ms - 867.38ms - faster ✔
2% - 5%
14.23ms - 44.01ms
branch 937 kB 875.82ms - 892.50ms slower ❌
2% - 5%
14.23ms - 44.01ms
-

combobox permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 1 MB 71.17ms - 73.27ms - faster ✔
0% - 3%
0.16ms - 2.56ms
branch 959 kB 73.00ms - 74.16ms slower ❌
0% - 4%
0.16ms - 2.56ms
-

light-dom-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 1 MB 763.48ms - 786.28ms - slower ❌
5% - 8%
33.09ms - 60.43ms
branch 959 kB 720.59ms - 735.65ms faster ✔
4% - 8%
33.09ms - 60.43ms
-

contextual-help permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 944 kB 114.78ms - 122.54ms - unsure 🔍
-7% - +1%
-8.02ms - +1.74ms
branch 899 kB 118.85ms - 124.75ms unsure 🔍
-2% - +7%
-1.74ms - +8.02ms
-

menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 741 kB 406.00ms - 421.92ms - unsure 🔍
-5% - +0%
-20.28ms - +1.72ms
branch 718 kB 415.64ms - 430.84ms unsure 🔍
-0% - +5%
-1.72ms - +20.28ms
-

overlay permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 1.06 MB 686.85ms - 705.99ms - slower ❌
6% - 10%
41.58ms - 64.46ms
branch 1.02 MB 637.12ms - 649.68ms faster ✔
6% - 9%
41.58ms - 64.46ms
-

directive-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 1.06 MB 53.11ms - 54.45ms - faster ✔
2% - 5%
0.98ms - 2.74ms
branch 1.02 MB 55.07ms - 56.21ms slower ❌
2% - 5%
0.98ms - 2.74ms
-

element-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 1.05 MB 697.39ms - 715.93ms - slower ❌
6% - 10%
40.78ms - 64.94ms
branch 1.01 MB 646.05ms - 661.55ms faster ✔
6% - 9%
40.78ms - 64.94ms
-

lazy-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 851 kB 97.42ms - 107.18ms - unsure 🔍
-5% - +6%
-4.91ms - +5.63ms
branch 806 kB 99.97ms - 103.91ms unsure 🔍
-5% - +5%
-5.63ms - +4.91ms
-

picker permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 817 kB 1004.95ms - 1014.49ms - faster ✔
5% - 8%
48.98ms - 84.94ms
branch 776 kB 1059.35ms - 1094.01ms slower ❌
5% - 8%
48.98ms - 84.94ms
-

popover permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 817 kB 150.74ms - 157.70ms - unsure 🔍
-4% - +2%
-6.49ms - +3.65ms
branch 775 kB 151.96ms - 159.32ms unsure 🔍
-2% - +4%
-3.65ms - +6.49ms
-

tooltip permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 956 kB 85.59ms - 90.69ms - slower ❌
9% - 18%
7.22ms - 13.86ms
branch 912 kB 75.47ms - 79.73ms faster ✔
8% - 15%
7.22ms - 13.86ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 831 kB 51.30ms - 53.82ms - unsure 🔍
-4% - +1%
-2.16ms - +0.72ms
branch 789 kB 52.58ms - 53.98ms unsure 🔍
-1% - +4%
-0.72ms - +2.16ms
-

test-element permalink

Version Bytes Avg Time vs remote vs branch
npm latest 956 kB 150.48ms - 155.88ms - slower ❌
11% - 17%
14.74ms - 22.38ms
branch 912 kB 131.92ms - 137.32ms faster ✔
10% - 14%
14.74ms - 22.38ms
-

test-lazy permalink

Version Bytes Avg Time vs remote vs branch
npm latest 932 kB 89.95ms - 93.29ms - faster ✔
23% - 30%
27.83ms - 39.33ms
branch 887 kB 119.70ms - 130.70ms slower ❌
30% - 43%
27.83ms - 39.33ms
-

truncated permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 789 kB 112.09ms - 119.11ms - faster ✔
0% - 9%
0.12ms - 11.68ms
branch 763 kB 116.91ms - 126.09ms slower ❌
0% - 10%
0.12ms - 11.68ms
-

Copy link
Contributor

@Rajdeepc Rajdeepc left a comment

Choose a reason for hiding this comment

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

Amazing! Great catch!
nit: Would it be possible to create a reference test on the below test case to make sure the scroll also works in Webkit and Firefox engines which will make sure that we are not creating regressions on different browser contexts.
Please refer to this test
You can use the below API to test for Webkit engines:

import { isWebKit } from '@spectrum-web-components/shared';

Rajdeepc
Rajdeepc previously approved these changes Dec 3, 2024
@AndreiBaicu26
Copy link
Contributor

Hi @caseyisonit and @Rajdeepc ! The flex css was specifically removed for this bug:
#4902. Is there any other possible sollution ?

Please see recordings attached.

@nikkimk
Copy link
Contributor

nikkimk commented Dec 3, 2024

@nikkimk
Copy link
Contributor

nikkimk commented Dec 3, 2024

Hi @caseyisonit and @Rajdeepc ! The flex css was specifically removed for this bug:
#4902. Is there any other possible sollution ?

We should probably have tests for both #4902 and for this fix to prevent reversions.

@caseyisonit
Copy link
Collaborator Author

Hi @caseyisonit and @Rajdeepc ! The flex css was specifically removed for this bug: #4902. Is there any other possible sollution ?

Please see recordings attached.

@AndreiBaicu26 I took a look at the recordings and that looks like it is a custom implementation. Based on the review link in this PR, the tooltip is rendering as expected, and I believe this display: flex should be added back in since it introduced SEV 1 breaking bugs for other components.

Once this change is reverted, if you encounter the original bug you noticed before, we ask that you submit a GitHub issue and include an isolated code example that reproduces the bug.

I will be reviewing our tests and screenshots covering these edge cases to make sure there is coverage to capture regressions.

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

Successfully merging this pull request may close these issues.

5 participants