Skip to content

Conversation

@wnvko
Copy link
Contributor

@wnvko wnvko commented Jan 30, 2026

Use popover global attribute to show the overlay. We are adding the attribute to overlay wrapper element and show the overlay by calling showPopover.

Closes #16824.

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

@wnvko wnvko added the ❌ status: awaiting-test PRs awaiting manual verification label Jan 30, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the overlay service by adopting the native Popover API to manage element layering, replacing the traditional z-index approach. The implementation adds the popover="manual" attribute to overlay wrapper elements and uses showPopover()/hidePopover() methods to control visibility in the browser's top layer.

Changes:

  • Added Popover API integration with showPopover() call before positioning and hidePopover() during cleanup
  • Removed z-index styling in favor of browser-managed top layer positioning
  • Added comprehensive style overrides to reset browser default popover styles while maintaining custom overlay positioning

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
projects/igniteui-angular/core/src/services/overlay/overlay.ts Implements Popover API calls in show/hide logic with proper error handling and browser compatibility checks
projects/igniteui-angular/core/src/core/styles/components/overlay/_overlay-theme.scss Removes z-index properties and adds popover attribute styles to override browser defaults

if (info.wrapperElement && info.wrapperElement.isConnected && typeof info.wrapperElement.showPopover === 'function') {
try {
info.wrapperElement.showPopover();
} catch (_) {
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Empty catch block swallows errors silently. Consider logging the error for debugging purposes or at minimum use a more descriptive parameter name like _error to indicate intentional suppression.

Suggested change
} catch (_) {
} catch (_error) {

Copilot uses AI. Check for mistakes.
info.wrapperElement.matches(':popover-open')) {
try {
info.wrapperElement.hidePopover();
} catch (_) {
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Empty catch block swallows errors silently. Consider logging the error for debugging purposes or at minimum use a more descriptive parameter name like _error to indicate intentional suppression.

Suggested change
} catch (_) {
} catch (_error) {

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +38
// Reset popover defaults to use our positioning with !important to override UA styles
position: fixed !important;
inset: 0 !important;
margin: 0 !important;
border: 0 !important;
padding: 0 !important;
width: auto !important;
height: auto !important;
max-width: none !important;
max-height: none !important;
overflow: visible !important;
background: transparent !important;
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Extensive use of !important on every property suggests a specificity battle with browser defaults. Consider whether all these overrides are necessary, or if a more targeted approach using a higher specificity selector could reduce the need for !important flags.

Suggested change
// Reset popover defaults to use our positioning with !important to override UA styles
position: fixed !important;
inset: 0 !important;
margin: 0 !important;
border: 0 !important;
padding: 0 !important;
width: auto !important;
height: auto !important;
max-width: none !important;
max-height: none !important;
overflow: visible !important;
background: transparent !important;
// Reset popover defaults to use our positioning and override UA styles via selector specificity
position: fixed;
inset: 0;
margin: 0;
border: 0;
padding: 0;
width: auto;
height: auto;
max-width: none;
max-height: none;
overflow: visible;
background: transparent;

Copilot uses AI. Check for mistakes.
@wnvko wnvko marked this pull request as draft January 30, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use popover attribute in Overlay service

3 participants