michaelbromley / michaelbromley/angularUtils

Change page again before async request is complete

Open
#314 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2k
Forks
842
PR merge metrics
No merged PRs in 30d

Description

I'm not sure if this is a bug or a problem on my side. When I double click either side of three dots, I get an infinite loop of some kind.

  1. When you click a page number: that number becomes active, shifts to left or to right synchronously, makes a request async.
  2. When you click a page number again: same as above.
  3. Request that was made by point 1) resolves. It updates data, current page, page size etc.
    At this point, current page in pagination control and current page of the request are different so there is some kind of a clash?
  4. Request that was made by point 2) resolves.

I cannot share any code. But I have an idea about the difference between common use case and my use case: I update current page and page size after each request.

So as a workaround, I want to disable pagination control during a request. Any suggestions? I don't think there's an ng-disabled on the pagination control.

Obviously I can do it inside on-page-change handler, I was just wondering if there's any way to apply "disabled" style to the whole element.

untitled screencast 1 1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names the pagination control and the on-page-change handler, but no files or tests. Start by locating the control and its asynchronous page-change path; done should mean the control can be disabled while a request is pending and repeated clicks no longer cause the reported loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.