-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Expandable row scrolling jumps #2162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @jon-armstrong , |
@jpuri, I am already setting expandableRowHeight. Otherwise, it looks like the code defaults to 150. Either way, the problem is the same. Thanks for looking into it. |
Hi @jon-armstrong , I could replicate and check the scroll issue you are mentioning, but the way scrolling is currently implemented in grid, fixing this issue will be bigger task. You can use the upward and downward arrows for scrolling, I checked they are working correctly. |
I did notice that the scrollbar controls still work, but that probably won't work for end users who will expect the scroll wheel to work the same as everywhere else. I'd still like to see this fixed, but have redesigned the data presentation into two tables instead of using expandable rows. |
@jon-armstrong , I am looking at this issue, I will update you in 1-2 days. |
Apparently the scroll event getting propagated to parent grid and its starts scrolling. Scroll event can not be cancelled nor can we stop its propagation. The default behavior of browsers to not to scroll the parent until child is totally scrolled (is at topmost or bottommost position). But ui-grid is not using default scrolling provided by browsers, but has rather implemented its own (for performance reasons). @c0bra , can you suggest something to fix this. |
Experiencing the same issue. |
All, I don't have a solution off the top of my head. Obviously we need to somehow prevent the parent grid from receiving the bubbled-up scroll event. Are we sure can we not prevent propagation? The grid already doesn't seem to bubble the event up to the parent document and allow scroll events from inside the viewport to scroll the document. |
Hey @c0bra, scroll is Non-Cancelable: https://developer.mozilla.org/en-US/docs/Web/Events/scroll The way browsers implement scrolling is that parent element does not scroll until child is fully scrolled and reaches its top or bottom. But its tough for us to implement it in this way because for its Non-Cancelable nature. |
We can probably check something like mousewheel event, I found this event fixing the issue to some extent. |
I am experiencing the same issue. I would like for my expandable row to scroll when the content inside of it is too large to fit within expandableRowHeight. Setting overflow-y: scroll; doesn't work like it should because of this event propagation issue. Anybody have any other ideas to get this to work? Thanks. |
I have noticed this problem in the Expendable tutorial. What is the status? The strange thing is that the child scroll only works as expected if the parent is not scrolled at all. |
There is another issue with expandable. The expandable demo is broken too. When you do a expand all. The selection gets misalligned. The biggest problem is, if you scroll to the bottom, it even fails to render the last few rows and leaves a lot of empty spaces inside the grid. Any hint on what could be the issue. I am happy to fix the expandable grid |
I had the same issue, I fixed it by setting the expandableRowHeight to high number (400) |
Hello all, is this issue still not resolved ? |
Hello everyone, |
The problem is in scroll wheel this is workaround/hack: /*
* this file is fix for long standing bug in ui-grid
* https://github.com/angular-ui/ui-grid/issues/2162
*/
(function () {
'use strict';
angular
.module('divosUiApp.widget.grid')
.directive('wheelFix', wheelFix);
function wheelFix() {
return {
restrict: 'A',
link: function link($scope, $element) {
var $container = $element.find('.ui-grid-render-container');
// wait for rendering of ui-grid
if (!$container.length) {
setTimeout(link.bind(this, $scope, $element), 400);
}
// code copied from $destroy in ui-grid source code
['wheel', 'mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'].forEach(function(event) {
$container.off(event);
});
}
}
}
})(); and this directive to ui-grid element it will remove mousewheel handler, I don't think it's needed (the event). <div wheel-fix ui-grid="gridOptions"></div> I have same code (custom mousewheel) in my project jQuery Terminal that was started in 2011, I didn't removed that code from the library though. but user can disable it (by setting his own handler) and he can scroll the output of the terminal. If you want to fix this bug, it's somewhere in mouse wheel logic ui-grid-render-container.js#L67 but I would just remove it, if it just scroll the view, unless it do some other logic. |
|
I have configured a grid with expandable rows, but my expandable row groups have a variable number of rows. Since the row height on the main grid is required to be a fixed value, I need the rows within the expandable row group to scroll so I can see the ones that don't fit in the viewport. Unfortunately, when I attempt to scroll within the row group, the scroll jumps around (tested in Mac Firefox and Chrome). It appears that the scroll listener from the main grid may be interfering. Basically, this happens whenever the height of the expandable rows exceeds the row height on the parent table.
Since it has been indicated elsewhere (#1887) that variable row height isn't something that will be implemented, which would be another solution to this issue, then being able to scroll properly within the expandable row group would be appreciated.
The text was updated successfully, but these errors were encountered: