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

TabView: Forward button doesnt disappear when the container size varies #6442

Closed
jerrin opened this issue Apr 22, 2024 · 10 comments · Fixed by #6449, leoo1992/GeradorQRCode#23 or leoo1992/GeradorQRCode#27
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@jerrin
Copy link

jerrin commented Apr 22, 2024

Describe the bug

The forward button doesnt disappear for TabView Scrollable component when the container width is set and scrolled to the last tab.

I believe the conditions for the button visibility needs to be adjusted here

Reproducer

https://stackblitz.com/edit/vitejs-vite-dthk4c?file=src%2FApp.tsx,src%2Fmain.tsx,package.json

PrimeReact version

10.6.3

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Chrome

Steps to reproduce the behavior

  1. Use the StockBlitz example from https://primereact.org/tabview/#scrollable
  2. set the width of the container div to 400px
  3. Navigate to the last tab but the forward button still visible
Screenshot 2024-04-22 at 12 53 47

Expected behavior

Forward button must disappear when scolled to last tab

@jerrin jerrin added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 22, 2024
@melloware
Copy link
Member

@jerrin PR is welcome!

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 22, 2024
@Rekl0w
Copy link
Contributor

Rekl0w commented Apr 22, 2024

Can you provide a stackblitz link for this issue, i tried but it worked on mine.

@melloware melloware added Status: Needs Reproducer Issue needs a runnable reproducer and removed Type: Bug Issue contains a defect related to a specific component. labels Apr 22, 2024
Copy link

Please fork the Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days.

@jerrin
Copy link
Author

jerrin commented Apr 22, 2024

Can you provide a stackblitz link for this issue, i tried but it worked on mine.

Here we go, https://stackblitz.com/edit/vitejs-vite-dthk4c?file=src%2FApp.tsx,src%2Fmain.tsx,package.json

I could reproduce the issue consistently on Chrome but not on Firefox.

screencast-stackblitz.com-2024.04.22-13_36_20.webm

@jerrin jerrin changed the title TabView: Forward button doesnt diappear when the container size varies TabView: Forward button doesnt disppear when the container size varies Apr 22, 2024
@jerrin jerrin changed the title TabView: Forward button doesnt disppear when the container size varies TabView: Forward button doesnt disappear when the container size varies Apr 22, 2024
@Rekl0w
Copy link
Contributor

Rekl0w commented Apr 22, 2024

I tried at different browsers but still it works on mine.

@melloware melloware added Resolution: Needs More Information More information about the issue is needed to find a correct solution and removed Status: Needs Reproducer Issue needs a runnable reproducer labels Apr 22, 2024
@melloware
Copy link
Member

Looks like PrimeVue does something similar but not exact

https://github.com/primefaces/primevue/blob/b2a4af2fce93772581dbec5712e54c18ab6d613b/components/lib/tabview/TabView.vue#L330-L337

@Rekl0w
Copy link
Contributor

Rekl0w commented Apr 22, 2024

PrimeVue has one difference that it parses scrollLeft to integer, rest are same.

@jerrin
Copy link
Author

jerrin commented Apr 22, 2024

Perhaps round up the scrollLeft value while evaluating the condition?

Screenshot 2024-04-22 at 16 21 36

@melloware
Copy link
Member

That must be the intent of parseInt(scrollLeft) in PrimeVue.

melloware added a commit to melloware/primereact that referenced this issue Apr 22, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Resolution: Needs More Information More information about the issue is needed to find a correct solution labels Apr 22, 2024
@melloware melloware self-assigned this Apr 22, 2024
@melloware melloware added this to the 10.6.4 milestone Apr 22, 2024
@melloware
Copy link
Member

Fixed for next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
4 participants