Skip to content
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

Stick table not applied when the element is not visible during ajax load #18417

Open
peterhashair opened this issue Nov 30, 2021 · 0 comments
Open
Labels
c: Design / UI For issues that impact Matomo's user interface or the design overall.

Comments

@peterhashair
Copy link
Contributor

peterhashair commented Nov 30, 2021

Expected Behavior

Stick table should be canceled on the table has X-axis scrolling

Current Behavior

I was on another issue notice the stick table has a bug, that issue is related to one of my PR. #18124

The problem is when the dataTableScroller is not visible during an ajax load. it won't process overflow-x', 'scroll', leading the entire page to scroll on the X-axis.

Steps to Reproduce (for Bugs)

To reproduce this, on the goals overview page, when you have more than 10 goals, it should appear.

Related Code

enableStickHead: function (domElem) {
// Bind to the resize event of the window object
$(window).on('resize', function () {
var tableScrollerWidth = $(domElem).find('.dataTableScroller').width();
var tableWidth = $(domElem).find('table').width();
if (tableScrollerWidth < tableWidth) {
$('.dataTableScroller').css('overflow-x', 'scroll');
}
// Invoke the resize event immediately
}).resize();
},

Possible Solution

I guess there are 2 solutions. Wait ajax is finished if there is one. then call enable function, or do an internal time, check it class is visible, once it's visible run the function and clear the timer.

@peterhashair peterhashair added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Nov 30, 2021
@peterhashair peterhashair changed the title Stick table not resize when the element is not visible Stick table not applied when the element is not visible Nov 30, 2021
@peterhashair peterhashair changed the title Stick table not applied when the element is not visible Stick table not applied when the element is not visible during ajax load Nov 30, 2021
@peterhashair peterhashair added c: Design / UI For issues that impact Matomo's user interface or the design overall. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. labels Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Design / UI For issues that impact Matomo's user interface or the design overall.
Projects
None yet
Development

No branches or pull requests

2 participants