Skip to content

feat(select): switch default to AutoPositionStrategy; export IgxSelectOverlapPositionStrategy as opt-in#17344

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/change-default-positioning-igx-select
Draft

feat(select): switch default to AutoPositionStrategy; export IgxSelectOverlapPositionStrategy as opt-in#17344
Copilot wants to merge 2 commits into
masterfrom
copilot/change-default-positioning-igx-select

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

igx-select previously defaulted to an internal SelectPositioningStrategy that forced the selected item's text to overlap the input — a tightly-coupled, unexported strategy with no public escape hatch. This changes the default to the standard AutoPositionStrategy (connected to the input, auto-flips when out of viewport) and exposes the previous behavior as an explicit opt-in.

Changes

  • New file select-overlap-positioning-strategy.ts — renamed from select-positioning-strategy.ts; class renamed SelectPositioningStrategyIgxSelectOverlapPositionStrategy

    • Constructor type changed from IgxSelectBase to IgxSelectComponent via import type to avoid a runtime circular import
    • Added ownsScrollPositioning = true marker property so the component can detect the strategy without an instanceof reference
  • select.component.ts — default positionStrategy in _overlayDefaults changed to new AutoPositionStrategy(...) with the same PositionSettings defaults (fade animations, Right/Bottom alignment). The instanceof SelectPositioningStrategy guard in onToggleContentAppended replaced with a property-read check (ownsScrollPositioning), removing the value import dependency entirely.

  • public_api.ts — exports IgxSelectOverlapPositionStrategy so consumers can construct it directly.

Opt-in to legacy overlap behavior

@ViewChild('select') select: IgxSelectComponent;

ngAfterViewInit() {
  this.select.overlaySettings = {
    positionStrategy: new IgxSelectOverlapPositionStrategy(this.select)
  };
}

Tests

Two new specs added:

  • Asserts _overlayDefaults.positionStrategy is an AutoPositionStrategy instance by default
  • Asserts assigning IgxSelectOverlapPositionStrategy via overlaySettings is accepted and the dropdown opens/closes correctly

Copilot AI changed the title [WIP] Change default positioning strategy for igx-select component feat(select): switch default to AutoPositionStrategy; export IgxSelectOverlapPositionStrategy as opt-in Jun 22, 2026
Copilot AI requested a review from damyanpetev June 22, 2026 17:32
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.

2 participants