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

Feature/popover container firefox polyfill #628

Merged
merged 40 commits into from
Nov 8, 2023

Conversation

JesmoDev
Copy link
Contributor

@JesmoDev JesmoDev commented Oct 26, 2023

Description

This PR introduces a polyfill for the popover container, enhancing its functionality to ensure proper compatibility with Firefox browsers. The polyfill has been integrated in a minimally intrusive manner, preserving the original structure of the popover container element. Removing just one line of code from the popover container element will effectively disable the polyfill.

This polyfill supports:

  • open / close
  • positioning
  • light dismiss

Also edits findAncestorByAttributeValue in uui-base, so that it also checks shadow root hosts

Known bugs:

  • light dismiss does not trigger if clicking on another popover-container or a popover container trigger.
  • light dismiss does not trigger if focus goes outside the dom (when focusing nothing)

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)

Motivation and context

Currently, due to the lack of support for the new popover API in Firefox, we are unable to utilize the popover container. With this polyfill, the popover container can now offer a user experience in Firefox that is nearly on par with that of supported browsers.

  • If my change requires 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.

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

1 similar comment
@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

2 similar comments
@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

Copy link

github-actions bot commented Nov 2, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

Copy link

github-actions bot commented Nov 2, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

@bjarnef
Copy link
Contributor

bjarnef commented Nov 3, 2023

Not sure if it worth trying this project:
https://github.com/oddbird/popover-polyfill

Based on the demos it seems to work in Firefox:
https://popover-polyfill.netlify.app/

but it has some Caveats like native :popver-open pseudo class vs :popver-open CSS class, so styling would probably need something like this:

:popver-open,
.:popver-open {
    // styling here
}

Copy link

github-actions bot commented Nov 7, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

@JesmoDev
Copy link
Contributor Author

JesmoDev commented Nov 7, 2023

@bjarnef I've looked at the oddbird polyfill, and I can't get it to work properly in bigger applications, such as New Backoffice, due to z-index issues.

@JesmoDev JesmoDev marked this pull request as ready for review November 7, 2023 09:04
Copy link

github-actions bot commented Nov 7, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

Copy link
Contributor

@iOvergaard iOvergaard left a comment

Choose a reason for hiding this comment

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

We agreed on the following:

  • Clean up the popover container story (remove test)
  • Change experimental warning to say that it now will work in all browsers due to a polyfill (but it is still experimental)
  • Make it 1-1 with the old popover stories
  • Add deprecation warnings to the old Popover element

@iOvergaard iOvergaard added the enhancement New feature or request label Nov 8, 2023
Copy link

github-actions bot commented Nov 8, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

Copy link

github-actions bot commented Nov 8, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

1 similar comment
Copy link

github-actions bot commented Nov 8, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

Copy link

github-actions bot commented Nov 8, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

1 similar comment
Copy link

github-actions bot commented Nov 8, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-628.westeurope.azurestaticapps.net

@iOvergaard iOvergaard enabled auto-merge (squash) November 8, 2023 09:59
@iOvergaard iOvergaard merged commit 7242825 into v1/contrib Nov 8, 2023
9 of 10 checks passed
@iOvergaard iOvergaard deleted the feature/popover-container-firefox-polyfill branch November 8, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants