Vue - AutoScrollTop on pagination not working and pageChange event not emitted
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu trong packages/vue/src/components/result/ReactiveList.jsx và kiểm tra watcher của hits cùng điều kiện loading của nó. Tái hiện phân trang bằng ReactiveList, sau đó xác minh rằng việc chuyển trang sẽ cuộn lên đầu theo mặc định và phát ra sự kiện pageChange.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Affected Projects
Vue.JS
Library Version:
1.29.0
Describe the bug
When clicking on a page number, the ReactiveList component should scroll to top (by default) and should send a pageChange event.
In my case, the scroll is not done and I never get the pageChange event.
I think I found the problem in the code of the /packages/vue/src/components/result/ReactiveList.jsx component:
hits(newVal, oldVal) {
this.$emit('data', this.getData());
if (this.shouldRenderPagination) {
// called when page is changed
if (this.isLoading && (oldVal || newVal)) {
if (this.hasPageChangeListener) {
this.$emit('pageChange', this.currentPageState + 1, this.totalPages);
this.$emit('page-change', this.currentPageState + 1, this.totalPages);
} else if (this.scrollOnChange) {
window.scrollTo(0, 0);
}
}
I can be wrong but I think that the line
if (this.isLoading && (oldVal || newVal)) {
should be
if (!this.isLoading && (oldVal || newVal)) {
It's missing a NOT before this.isLoading. Else it will never execute the code that is following the condition because the loading is finished since a while at this time.
- Ngôn ngữ chính
- JavaScript
- Star
- 4.9k
- Fork
- 479
- Merge trung bình
- 4 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của appbaseio/reactivesearch
-
ci: add Node.js version matrix, caching, and lint step to test workflowCó thể đã có người làm @Talha12Shiekh đã nhận 70 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
appbaseio/reactivesearch#2322 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore: add Dependabot config for automated dependency updatesCó thể đã có người làm @Talha12Shiekh đã nhận 70 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
appbaseio/reactivesearch#2321 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
security: user-controlled URL params injected directly into Redux store via JSON.parseCó thể đã có người làm @Talha12Shiekh đã nhận 70 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
appbaseio/reactivesearch#2319 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refactor: consolidate 12 near-identical SVG icon components into one patternCó thể đã có người làm @Talha12Shiekh đã nhận 72 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
appbaseio/reactivesearch#2324 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refactor: SearchBox.js is 2692 lines — extract subcomponents for maintainabilityCó thể đã có người làm @Talha12Shiekh đã nhận 70 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
appbaseio/reactivesearch#2323 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của appbaseio/reactivesearch
Issue tương tự
-
Engineering
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
techmatters/terraso-web-client#3095 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Service process inherits the caller's cwd at first use, holding that folder open on Windows (EBUSY)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nextcloud/viewer#3424 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày