Skip to content

bug(Select): MAT_SELECT_SCROLL_STRATEGY issue #30620

Closed
@laliconfigcat

Description

@laliconfigcat

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

19.1.x

Description

I asked for a new feature recently, introducing the MAT_TIMEPICKER_SCROLL_STRATEGY: #30421

It has been implemented, but there was a bug, after opening the Timepicker and closing it via scroll (with a close scroll strategy), the Timepicker could not be opened again: #30558

That issue was solved in 19.2.x and it is working fine.

But in 19.2.x, now the Select is having the same issue when having a close scroll strategy as MAT_SELECT_SCROLL_STRATEGY.

const closeScrollStrategyFactory = (overlay: Overlay): (() => CloseScrollStrategy) => {
  return () => overlay.scrollStrategies.close();
};

After opening the select, and closing it via scrolling on the page, the select cannot be opened again.
I'm not sure if the issue has anything to do with the TimePicker.

We have the same scroll strategy for MAT_DATEPICKER_SCROLL_STRATEGY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY and MAT_MENU_SCROLL_STRATEGY, all the others are working fine.

Reproduction

StackBlitz link: https://stackblitz.com/edit/timepicker-scroll-strategy-issue-cjulrhcw?file=src%2Fmain.ts
Steps to reproduce:

  1. Open the select.
  2. Scroll on the page.
  3. The select should be closed.
  4. Try opening the select again, it won't work

Expected Behavior

We should be able to reopen the select after it is closed with a scroll strategy.

Actual Behavior

The select cannot be reopened.

Environment

  • Angular: 19.2.x
  • CDK/Material: 19.2.x
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/select

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions