Skip to content

Conversation

@Rajdeepc
Copy link
Contributor

@Rajdeepc Rajdeepc commented Nov 29, 2023

Description

type=auto was taking up the root dialog component as its parent and rendering the sp-tray considering dialog as its root instead of the DOM.

Related issue(s)

Motivation and context

How has this been tested?

  • Test case 1
    Do this:
    1. Add the below code in picker.stories.ts and try to emulate it in a iphone simulatorwith xcode.
    <overlay-trigger type="modal" open="click">
      <div slot="click-content" role="dialog">
        <sp-underlay style="z-index: 10000;"></sp-underlay>
        <div style="  position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 10001; background-color: yellow; padding: 20px">
          <div style="display: flex; flex-direction: column; gap: 40px">
            <sp-picker id="picker-m" size="m" label="Selection type" ${spreadProps(args)}>
              <sp-menu-item>Deselect</sp-menu-item>
              <sp-menu-item>Select inverse</sp-menu-item>
              <sp-menu-item>Feather...</sp-menu-item>
              <sp-menu-item>Select and mask...</sp-menu-item>
              <sp-menu-divider></sp-menu-divider>
              <sp-menu-item>Save selection</sp-menu-item>
              <sp-menu-item disabled>Make work path</sp-menu-item>
            </sp-picker>
            <sp-picker id="picker-m" size="m" label="Selection type">
              <sp-menu-item>Deselect</sp-menu-item>
              <sp-menu-item>Select inverse</sp-menu-item>
              <sp-menu-item>Feather...</sp-menu-item>
              <sp-menu-item>Select and mask...</sp-menu-item>
              <sp-menu-item>Save selection</sp-menu-item>
              <sp-menu-item disabled>Make work path</sp-menu-item>
            </sp-picker>
          </div>
        </div>
    </overlay-trigger>
    

Screenshots (if appropriate)

Before Fix:

Screenshot 2023-11-29 at 8 58 28 PM

After Fix:
Screenshot 2023-11-29 at 8 58 17 PM

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.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 29, 2023

@Rajdeepc Rajdeepc linked an issue Nov 29, 2023 that may be closed by this pull request
1 task
@github-actions
Copy link
Contributor

github-actions bot commented Nov 29, 2023

Tachometer results

Chrome

action-menu permalink

Version Bytes Avg Time vs remote vs branch
npm latest 640 kB 192.35ms - 196.55ms - unsure 🔍
-1% - +2%
-1.93ms - +3.57ms
branch 623 kB 191.84ms - 195.41ms unsure 🔍
-2% - +1%
-3.57ms - +1.93ms
-

picker permalink

Version Bytes Avg Time vs remote vs branch
npm latest 506 kB 662.72ms - 678.50ms - unsure 🔍
-1% - +2%
-7.72ms - +13.27ms
branch 493 kB 660.92ms - 674.76ms unsure 🔍
-2% - +1%
-13.27ms - +7.72ms
-

split-button permalink

Version Bytes Avg Time vs remote vs branch
npm latest 712 kB 1854.52ms - 1857.53ms - unsure 🔍
-0% - +0%
-4.33ms - +0.55ms
branch 697 kB 1855.99ms - 1859.84ms unsure 🔍
-0% - +0%
-0.55ms - +4.33ms
-
Firefox

action-menu permalink

Version Bytes Avg Time vs remote vs branch
npm latest 640 kB 330.73ms - 341.11ms - unsure 🔍
-2% - +2%
-6.55ms - +7.03ms
branch 623 kB 331.30ms - 340.06ms unsure 🔍
-2% - +2%
-7.03ms - +6.55ms
-

picker permalink

Version Bytes Avg Time vs remote vs branch
npm latest 506 kB 980.41ms - 1003.39ms - unsure 🔍
-1% - +2%
-8.90ms - +14.86ms
branch 493 kB 985.91ms - 991.93ms unsure 🔍
-1% - +1%
-14.86ms - +8.90ms
-

split-button permalink

Version Bytes Avg Time vs remote vs branch
npm latest 712 kB 1568.49ms - 1571.95ms - unsure 🔍
-0% - +0%
-3.37ms - +1.57ms
branch 697 kB 1569.36ms - 1572.88ms unsure 🔍
-0% - +0%
-1.57ms - +3.37ms
-

@Westbrook
Copy link
Contributor

https://96f1ac07a365f3271d6365f89114585a--spectrum-web-components.netlify.app/review/ This is an unexpected failure. We should confirm that your change didn’t cause this or if there’s a change to the timing of the test/element that is needed.

@Rajdeepc Rajdeepc force-pushed the bug/overlay-picker branch 2 times, most recently from 03929b6 to 639d30d Compare November 30, 2023 11:08
@Rajdeepc
Copy link
Contributor Author

here’s a change to the timing of the test/element that is needed

I dont think this is failing due to change in type. I verified in a test PR. I can see the same VRT failures

public placement: Placement = 'bottom-start';

@property()
public overlayType: OverlayTypes = 'auto';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we update documentation somewhere on this property? I feel like the isMobile check where it changes to modal is a potential surprise to consumers. Can we also add/update any documentation for this property to communicate what it does?

Copy link
Contributor

Choose a reason for hiding this comment

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

I wasn’t clear about what I was hoping with this. I do not believe the user should have any control over this value.

However, we should be binding it to the sp-overlay as a property .type=${…} now that is dynamic so that it does not request paint/layout when changing unless required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding as .type=${this.isMobile.matches ? 'modal' : 'auto'}

@Westbrook
Copy link
Contributor

Please share why you think the change I referred to is not caused by this PR.

@Rajdeepc
Copy link
Contributor Author

Rajdeepc commented Dec 1, 2023

Please share why you think the change I referred to is not caused by this PR.

@Westbrook I dont find any visual differences on the first load of PR storybook and PROD storybook
PR: https://bug-overlay-picker--spectrum-web-components.netlify.app/storybook/?path=/story/picker--custom
PROD: https://opensource.adobe.com/spectrum-web-components/storybook/index.html?path=/story/picker--custom

Also I see all pass on the local VRT test on my branch for Picker. Seems like the VRT test is not picking up the hover state on picker items on CI
Screenshot 2023-12-01 at 12 37 07 PM

@Rajdeepc
Copy link
Contributor Author

Rajdeepc commented Dec 5, 2023

@Westbrook Mission Accomplished!!

@Rajdeepc Rajdeepc requested review from Westbrook and jnjosh December 5, 2023 16:23
Copy link
Contributor

@Westbrook Westbrook left a comment

Choose a reason for hiding this comment

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

Love it! Thanks for digging in on this one. :shipit:

@Westbrook Westbrook merged commit 4aba1c6 into main Dec 5, 2023
@Westbrook Westbrook deleted the bug/overlay-picker branch December 5, 2023 16:33
mirekszot pushed a commit that referenced this pull request Dec 6, 2023
* chore(picker): fix for overlaid picker in mobile

* chore: updated golden image cache

* chore(picker): fix for overlaid picker in mobile

* chore: updated golden image cache

* chore(picker): added property for type

* chore(picker): added type as a property

* chore(picker): removing overlay type as a property

* chore(picker): added triiger open decorator for custom picker

* chore(picker): reverting golden hash

---------

Co-authored-by: Rajdeep Chandra <rajdeepc@adobe.com>
mirekszot pushed a commit that referenced this pull request Dec 6, 2023
* chore(picker): fix for overlaid picker in mobile

* chore: updated golden image cache

* chore(picker): fix for overlaid picker in mobile

* chore: updated golden image cache

* chore(picker): added property for type

* chore(picker): added type as a property

* chore(picker): removing overlay type as a property

* chore(picker): added triiger open decorator for custom picker

* chore(picker): reverting golden hash

---------

Co-authored-by: Rajdeep Chandra <rajdeepc@adobe.com>
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.

[Bug]: swc-react picker is not working on an overlay in mobile only in Firefly

4 participants