mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 12:31:42 +00:00
Arreglar scroll al reordenar posts
Utilizaba https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded que es propietario. Ahora usa scrollIntoView siempre, configurado para que prácticamente siempre se pueda ver el post al reordenar.
This commit is contained in:
parent
d869b99baa
commit
6a7511a5e1
1 changed files with 3 additions and 7 deletions
|
@ -103,11 +103,7 @@ export default class extends Controller {
|
|||
this.reorder()
|
||||
|
||||
// Mantenemos el primero a la vista
|
||||
if ("scrollIntoViewIfNeeded" in rows[0].row) {
|
||||
rows[0].row.scrollIntoViewIfNeeded()
|
||||
} else {
|
||||
rows[0].row.scrollIntoView()
|
||||
}
|
||||
rows[0].row.scrollIntoView({ block: "center" });
|
||||
}
|
||||
|
||||
counter () {
|
||||
|
@ -146,7 +142,7 @@ export default class extends Controller {
|
|||
this.reorder()
|
||||
|
||||
// Mantenemos el primero a la vista
|
||||
rows[0].row.scrollIntoViewIfNeeded()
|
||||
rows[0].row.scrollIntoView({ block: "center" });
|
||||
}
|
||||
|
||||
bottom (event) {
|
||||
|
@ -167,7 +163,7 @@ export default class extends Controller {
|
|||
this.reorder()
|
||||
|
||||
// Mantenemos el primero a la vista
|
||||
rows[0].row.scrollIntoViewIfNeeded()
|
||||
rows[0].row.scrollIntoView({ block: "center" });
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue