element-plus [Component][pagination]pagination组件jumper输入框清空后,点击页码跳转会直接跳到第1页

vulvrdjw  于 1个月前  发布在  其他
关注(0)|答案(5)|浏览(35)

Bug Type: Component

Environment

  • Vue Version: 3.2.47
  • Element Plus Version: 2.3.4
  • Browser / OS: Chrome 110.0.5481.177 / macOS 12.6
  • Build Tool: Vite

Reproduction

  • el-pagination

Element Plus Playground

Steps to reproduce

1、先跳转非第1页的页码(例如第4页)
2、清空jumper输入框内的数字
3、在页码选择器上点任意一个非第1页和非第一步选择的页码(如点击6)

What is Expected?

页面直接跳转第三步选择的页码(如6)

What is actually happening?

会跳到第1页后再跳到第三步选择的页码(如6),继续重复上述步骤有时候会直接跳到第1页,有时候会先跳1再跳选择的页面

Additional comments

(empty)

s8vozzvw

s8vozzvw1#

清空输入框后,切换页码,输入框就会闪一下

cigdeys3

cigdeys32#

To be precise, two events are triggered, the setting page event when the input box is out of focus, and then your click event. This is a normal behavior. If this has some impact on your business request, you can consider using debounce to modify the change event.

whhtz7ly

whhtz7ly3#

demo.mov

有时候清空之后切换页码,会直接到第一页,不会继续跳到选中的页码

e4eetjau

e4eetjau4#

This should be caused by resetting the first page when the focus is lost, and the clicked position is reset to omission.

zlhcx6iw

zlhcx6iw5#

这种情况有什么优化方案吗?因为新选择的页码在省略号中间而不跳转,这种交互感觉会有点奇怪

相关问题