Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 - Select - dropdown content is not shown if initial state is opened #9224

Closed
r0ss0neri opened this issue Sep 26, 2024 · 6 comments · Fixed by #9581
Closed

🐞 - Select - dropdown content is not shown if initial state is opened #9224

r0ss0neri opened this issue Sep 26, 2024 · 6 comments · Fixed by #9581
Assignees
Labels
P1 This issue has high priority S2 This issue has medium severity

Comments

@r0ss0neri
Copy link
Contributor

Code Example URL

https://stackblitz.com/edit/angular-az8rzh?file=src/app/app.template.html,src/app/app.component.ts

Description

Use case is to open a dropdown menu for select automatically. I used [tuiDropdownOpen] which is coming from TuiDropdownOpenLegacy directive but for some reason it's not working (sorry didn't have time to debug more).

In provided example the problem is that dropdown open state is updated automatically to false. And also interesting example where tuiDropdownOpenChange is not used, please check here https://stackblitz.com/edit/angular-az8rzh-auyhbj?file=src%2Fapp%2Fapp.template.html.

In this case select is focused and arrow icon remains in the position when dropdown is opened, but dropdown content is not shown

image

Taiga UI version

4.8.1

Browser Used

Chrome

OS Used

macOS

@mohan-mu
Copy link
Contributor

Here is Working Example .

moved tuiDropdownOpen to AfterViewInit Lifecycle

https://stackblitz.com/edit/angular-az8rzh-ugvdqf?file=src%2Fapp%2Fapp.component.ts

@waterplea
Copy link
Collaborator

Dropdowns automatically close if the host is out of sight. Could be that if it is set to true initially it gets processed even before the element is properly added to DOM so it thinks that it's not visible and immediately closes. Would workaround by @mohan-mu work for you?

@r0ss0neri
Copy link
Contributor Author

Actually I provided a minimum reproducible example, in case if component will be instantiated later (e.g. hidden by ngIf) it will not work. Please check https://stackblitz.com/edit/angular-az8rzh-pztsag?file=src/app/app.template.html,src/app/app.component.ts

@r0ss0neri
Copy link
Contributor Author

r0ss0neri commented Sep 27, 2024

This approach with directive helper is working on stackblitz, but not in our application:) https://stackblitz.com/edit/angular-az8rzh-km4nwq?file=src%2Fapp%2Fapp.template.html,src%2Fapp%2Fapp.component.ts

@waterplea waterplea added P1 This issue has high priority S2 This issue has medium severity and removed state: need triage labels Sep 27, 2024
@r0ss0neri
Copy link
Contributor Author

@waterplea do you guys have any insight on when this bug might be fixed? We use this feature a lot in our application and our current workaround is not ideal for users, it takes 1s to open a menu (we use a setTimeout function). Thanks.

@waterplea
Copy link
Collaborator

I'm not sure yet, kind of swarmed with other stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 This issue has high priority S2 This issue has medium severity
Development

Successfully merging a pull request may close this issue.

3 participants