简体   繁体   English

Kendo Grid 奇怪的水平滚动行为与动态复选框

[英]Kendo Grid strange horizontal scroll behavior with dynamic checkbox

Reproduction [Stackblitz] :复制[Stackblitz]

  1. Click the "Toggle" button several times多次单击“切换”按钮

The horizontal grid scroll will jump at the start/end.水平网格滚动将在开始/结束处跳跃。 It looks like the grid's input [columnMenu]="{ filter: true }" affects this.看起来网格的输入[columnMenu]="{ filter: true }"影响了这一点。 If you delete this input, all works as expected and the scroll doesn't jump.如果您删除此输入,一切都会按预期工作并且滚动不会跳转。

Any thoughts or help?有什么想法或帮助吗? Thanks谢谢

This looks to be a known issue in kendo-angular这看起来是kendo-angular 中的一个已知问题

From the link above:从上面的链接:

Describe the bug描述错误

When hiding a column will cause the page to scroll to the Grid position.隐藏列时会导致页面滚动到 Grid 位置。 The issue is related to v5.0.1 ( kb-nav: content is scrolled to the top when focusing a header cell ).该问题与 v5.0.1 有关(kb-nav:聚焦标题单元格时内容会滚动到顶部)。 Locking the column will also focus on the last header cell and scroll the Grid horizontally (reference 1573208).锁定列还将关注最后一个标题单元格并水平滚动网格(参考 1573208)。

To Reproduce重现

Steps to reproduce the behavior:重现该行为的步骤:

open - https://stackblitz.com/edit/angular-uvszf5-fi8sx5?file=app%2Fapp.component.ts Press the hide column button Expected behavior Not losing focus and scrolling the Grid position打开 - https://stackblitz.com/edit/angular-uvszf5-fi8sx5?file=app%2Fapp.component.ts按下隐藏列按钮 预期行为 不会失去焦点并滚动网格位置

Workaround解决方法

The scroll can be disabled and re-enabled when pressing the button: https://stackblitz.com/edit/angular-uvszf5-jvbxlm?file=app%2Fapp.component.ts按下按钮时可以禁用和重新启用滚动: https ://stackblitz.com/edit/angular-uvszf5-jvbxlm?file=app%2Fapp.component.ts

A second workaround that keeps the horizontal scroll position of the Grid: https://stackblitz.com/edit/angular-7xgsx2-jkc1wm?file=src/app/app.component.ts保持网格水平滚动位置的第二种解决方法: https ://stackblitz.com/edit/angular-7xgsx2-jkc1wm?file=src/app/app.component.ts

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM