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

fix: Clickable Disabled Navigation Buttons in TrackTools Component #668

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Amit-K-007
Copy link

Description:

This PR addresses the issue where the "Prev" and "Next" buttons in the TrackTools component remain clickable even when disabled, resulting in unnecessary re-renders. This was happening because the Link component was still clickable even if the button inside it is disabled.

Changes Made:

  • Prev Button:

    • If problemIndex is 0, the pointer-events on the Link are disabled.
    • The Link is wrapped in a div that has a cursor: not-allowed style if problemIndex is 0 (indicating the First Slide).
  • Next Button:

    • If problemIndex + 1 equals the length of track.problems, the pointer-events on the Link are also disabled.
    • The Link is wrapped in a div that applies the cursor: not-allowed style if problemIndex + 1 equals the length of track.problems (indicating the Last Slide).

Demo

solution.mp4

Resolves: #667

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Disabled navigation buttons Prev and Next are still clickable
1 participant