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

[Bug Report] pagination pagesize binding in jumper #6809

Closed
StevenYuysy opened this issue Sep 1, 2017 · 7 comments
Closed

[Bug Report] pagination pagesize binding in jumper #6809

StevenYuysy opened this issue Sep 1, 2017 · 7 comments

Comments

@StevenYuysy
Copy link

Element UI version

1.4.3

OS/Browsers version

MacOS / Chrome

Vue version

2.4.2

Reproduction Link

https://jsfiddle.net/pj71jkyw/532/

Steps to reproduce

  • 点击 5
  • 删掉 jumper 里面的 5
  • 点击前进

What is Expected?

  • 此时应该是 6

What is actually happening?

  • 跳回第一页
@element-bot element-bot changed the title [Bug Report] pagination pagesize binding in jumper [Bug, Report], pagination, PageSize, binding, in, jumper Sep 1, 2017
@element-bot
Copy link
Member

Translation of this issue:

Element UI version

1.4.3

OS/Browsers version

MacOS / Chrome

Vue version

2.4.2

Reproduction Link

https://jsfiddle.net/pj71jkyw/532/

Steps to reproduce

  • click 5

  • delete 5 in jumper
    Click forward

What is Expected?

  • it should be 6 at this time

What is actually happening?

  • back to the first page

@StevenYuysy StevenYuysy changed the title [Bug, Report], pagination, PageSize, binding, in, jumper [Bu, Report] pagination pagesize binding in jumper Sep 1, 2017
@StevenYuysy StevenYuysy changed the title [Bu, Report] pagination pagesize binding in jumper [Bug Report] pagination pagesize binding in jumper Sep 1, 2017
@Leopoldthecoder
Copy link
Contributor

点击前进

哪里有「前进」?

@StevenYuysy
Copy link
Author

next

@huguangju
Copy link
Contributor

@StevenYuysy 删除jumper中的数字后,当前页跳到第1页并不是点击next直接导致的,而是jumper失焦后其值此时为空字符串,应用值到internalCurrentPage前会校验设置的页码,部分源码如下,会被设置为1:

getValidCurrentPage(value) {
      value = parseInt(value, 10);
      // ...
      if (resetValue === undefined && isNaN(value)) {
        resetValue = 1; // here
      } else if (resetValue === 0) {
        resetValue = 1;
      }
      return resetValue === undefined ? value : resetValue;
    }
  }

@StevenYuysy
Copy link
Author

StevenYuysy commented Sep 6, 2017

@huguangju
jumper 失焦时 innerCurrentPage 被设置为 0,但是实际上,失焦的时候,页面没有发生跳转, innerCurrentPage 不应该会发生变化。

@huguangju
Copy link
Contributor

@StevenYuysy innerCurrentPage 不会被设置为 0的。不过这里似乎存在问题,正常情况下,在 jumper
中输入页码后,仅应在按下回车键再作跳转比较合理。例如,我想跳到第20页,输完之后改变了主意想先直接点到第二页看看,目前的情况就是:当点击第二页时,会首先跳到第20页(若pageCount小于20则跳到pageCount),然后才会跳到第二页,也就是说 @current-change 会执行两次。

@stale
Copy link

stale bot commented Feb 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 18, 2019
@stale stale bot closed this as completed Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants