Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Vue - AutoScrollTop on pagination not working and pageChange event not emitted

Abierto
#1,973 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
javascript
Área
frontend

Línea de trabajo

Comienza en packages/vue/src/components/result/ReactiveList.jsx e inspecciona el watcher de hits y su condición de carga. Reproduce la paginación con ReactiveList y luego verifica que cambiar de página desplaza el scroll hasta la parte superior de forma predeterminada y emite el evento pageChange.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

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.

Lenguaje dominante
JavaScript
Estrellas
4.9k
Forks
479
Merge medio
4 d 10 h
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de appbaseio/reactivesearch

Todos los issues de appbaseio/reactivesearch

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.