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
Show a floating horizontal scrollbar for tables #1092
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why floating-scroll is used here? The plugin seems to have very limited use thus far so taking a dependency on it is not acceptable practice for mantisbt core.
core/layout_api.php
Outdated
@@ -271,6 +271,9 @@ function layout_head_css() { | |||
html_css_link( 'bootstrap-datetimepicker-' . DATETIME_PICKER_VERSION . '.min.css' ); | |||
} | |||
|
|||
# floating scroll (no cdn available) | |||
html_css_link( 'jquery.floatingscroll-' . FLOATING_SCROLL_VERSION . '.css' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why using another library for this? Is this not possible with perfect-scrollbar plugin that I have in use @ #1088?
It's a one-thing focused piece of code, that solves exactly the issue
Did you review if the use of perfect-scrollbar in that PR can be equivalent to just "overflow-y:auto;" the timeline container? #1088 (comment) Additionally, i tried but couldn't make perfect-scrollbar work for this scenario. Let me know if you find how to do it, if have more experience with that library. |
Wait... you want a scrollbar (horizontal & vertical) to be visible at all times if the table is larger than the screen, right? Did the legacy UI had this? Seems to go counter to how modern browsers handle scrollbar (desktop & mobile). They are always hidden. |
Not "if the table is larger than the screen", that is the standard browser scrollbar, where an element is out of screen. Look carefully, you'll see that the table container is never wider than the screen, but the content (table) is wider than the container. In this situation, the browser draws a standard horizontal scrollbar at the bottom of the container The table container spreads vertically, so the vertical scrollbar applies to the body, and is showed as its standard behaviour. Please try to reproduce this with a combination of enough content width and/or browser width, to understand the issue.
Old UI did not have this issue, because tables were not constrained to its container size, so the browser showed a standard horizontal scrollbar on the body always visible, whenever the table+container was wider than screen.
That's not applicable to this scenario. |
I think the snapshots are a bit confusing - couple of things: |
The behavior in the demo page at http://amphiluke.github.io/floating-scroll/ is exactly what I am looking for. The horizontal scrollbar appears when I try to scroll and disappears shortly after scroll movement is done. |
because the table container overflows past the browser screen. That is the standard layout, and no changes are intended on that, eg: limiting vertical height for the table container
The behaviour here is the same as the demo page. Note that the included script is very concise and is focused only in this feature, nothing else.
Not exactly. What you are experiencing, where the scroll bars get hidden after the movement is done, is surely dependent on your browser (I don't see that in any scroll bar with my browser). You can pull the PR tree and test it to make sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the two comments I have, this is good to go.
css/jquery.floatingscroll-2.3.0.css
Outdated
@@ -0,0 +1,34 @@ | |||
.fl-scrolls, .fl-scrolls div { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't check-in non-minified css/js for public plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the plugin does not offer a minified css.
Probably, because it contains only 8 rules...
js/jquery.floatingscroll-2.3.0.js
Outdated
@@ -0,0 +1,166 @@ | |||
/*! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
55f0bf4
to
9db1555
Compare
Already, removed non minified js. |
6ac130c
to
9ab4a31
Compare
any feedback on this? |
@cproensa I can't seem to notice any difference between |
This is old but still valid |
@cproensa merge of #1449 introduced conflicts in this one. They are quite straightforward and I could easily fix them, but I noticed that the floating-scroll library has been updated since then (2.3.3 and 3.0.4, the latter drops support for IE8 but our minimum req is IE11 so we should be fine with that I guess), so I let you decide if you want to update or not. |
Thanks for the update. It's a good sign that this project is active. |
Show a floating horizontal scrollbar for tables whose horizontal overflow is hidden under the container, and the native horizontal scrollbar is out of view when the length of the table exceeds the browser view area. Using JS code: https://github.com/Amphiluke/floating-scroll Fixes: #22132
9ab4a31
to
3519398
Compare
I have rebased and updated this branch with the new version, i will run it in production for the following days, but so far it doesn't show issues. |
Show a floating horizontal scrollbar for tables whose horizontal
overflow is hidden under the container, and the native horizontal
scrollbar is out of view when the length of the table exceeds the
browser view area.
Using JS code:
https://github.com/Amphiluke/floating-scroll
Fixes: #22132
Before:
After: