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

p-multiselect: Displaying the multiselect options dialog causes page to horizontally scroll #14611

Closed
rosenthalj opened this issue Jan 23, 2024 · 0 comments · Fixed by #14612
Closed
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@rosenthalj
Copy link
Contributor

Describe the bug

In a page that has a horizontal scroll bar and one or more multiselect options have previously been selected, when the multiselect is clicked the page will automatically scrolls.

The first video demonstrates this issue occurs in the PrimeNG v17.x filter row demo
https://primeng.org/table#filter-row (Note: https://primeng.org/table#filter-menu has the same issue)

multiselectScrollIntoViewBad1.mov

The second video demonstrates this issue using a reproducer that I created to isolate the problem.

multiselectScrollIntoViewBad2.mov

This issue is similar to the following issues that have been fixed: #14039 and #13390

The following changes to multiselect.ts will fix the problem:

GitHub_Desktop

Environment

windows and macos

Reproducer

https://stackblitz.com/edit/vr5hjz-jtttd7

Angular version

17.x

PrimeNG version

17.3.3

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.18.1

Browser(s)

safari, chrome, firefox

Steps to reproduce the behavior

  1. Run the reproducer: https://stackblitz.com/edit/vr5hjz-jtttd7
  2. Click on the multiselect
    -- The multiselect option dialog will display without scrolling (good)
  3. Select the "New York" option
  4. Close the multiselect options dialog by clicking on the "X"
  5. Click on the multiselect
    -- The multiselect option dialog will display and the panel scrolled to the right (bad)

Expected behavior

Step 6 should not cause the panel to scroll

@rosenthalj rosenthalj added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 23, 2024
@cetincakiroglu cetincakiroglu added this to the 17.4.0 milestone Jan 24, 2024
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 24, 2024
cetincakiroglu added a commit that referenced this issue Jan 24, 2024
fix #14611 -- fixed  multiselect scrollIntoView to use 'nearest'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants