angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.32k stars 6.73k forks source link

MatSelect and horizontal scroll problem #29539

Closed Azel-ytof closed 4 weeks ago

Azel-ytof commented 1 month ago

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

I don't know

Description

Hi, I'm facing a problem, I suppose with MatSelect.

I have a div that contains a breadcrumb path, which can be scrolled horizontally if it overflows. And I have MatSelect in the path to allow changing directory.

But when I'm at the end of the scrolled div (right), I scroll left and click on a MatSelect to change directory, the container jump to the end and do not let me select option...

So I supposed it is a bug because I've tried with a simple select and I do not have this problem (also in the stackblitz example)

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-de61iu?file=src%2Fapp%2Fcomponents%2Fsite-breadcrumb%2Fsite-breadcrumb-element%2Fsite-breadcrumb-element.component.html

Please provide the exception or error you saw

No exception or error, just the strange behavior of the scroll jump.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 16.2.14
Node: 22.2.0 (Unsupported)
Package Manager: npm 10.8.0
OS: win32 x64

Angular: 16.2.12
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1602.14
@angular-devkit/build-angular   16.2.14
@angular-devkit/core            16.2.14
@angular-devkit/schematics      16.2.14
@angular/cdk                    16.2.14
@angular/cli                    16.2.14
@angular/material               16.2.14
@schematics/angular             16.2.14
rxjs                            7.8.1
typescript                      5.0.4
zone.js                         0.13.3

Anything else?

I also face this problem in production in a docker image :

Thank you for your help ! :)

Azel-ytof commented 4 weeks ago

Hi, I've updated the stackblitz link because I've add the vanilla html example. I've also open a stackoverflow question to find a workaround. If this issue is not updated, go take a look on this stackoverflow, maybe someone succesfuly help me ?

kai1992cool commented 4 weeks ago

@Azel-ytof Its just a bug in the stackblitz code SO Answer, this issue can be closed once you provide confirmation!