Skip to content

bug(Timepicker): Problem with MAT_TIMEPICKER_SCROLL_STRATEGY #30558

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

No response

Description

First of all, thanks for implementing the MAT_TIMEPICKER_SCROLL_STRATEGY so fast!
I tried it with the newest version released yesterday and I run into a problem with it.

I am using a close scroll strategy like this:

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

...

{ provide: MAT_TIMEPICKER_SCROLL_STRATEGY, useFactory: closeScrollStrategyFactory, deps: [Overlay] },

When I open the Timepicker, it works fine but when the scrolling closes the Timepicker, it cannot be opened again.

Is my scroll strategy wrong somehow? Thanks in advance!

Reproduction

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

  1. Open the Timepicker dropdown (doesn't matter if you open it with the button or by clicking into the component)
  2. Start scrolling on the page, and it will close the Timepicker dropdown
  3. Try opening the Timepicker dropdown again, it won't open.

Expected Behavior

The Timepicker should open after closed by a scroll strategy.

Actual Behavior

The Timepicker cannot be opened after closed by a scroll strategy.

Environment

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

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions