-
Notifications
You must be signed in to change notification settings - Fork 90
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
Don't scroll datepicker in AppSidebar with body #1881
Conversation
Better reviewed as https://github.com/nextcloud/nextcloud-vue/pull/1881/files?w=1 But this is not my level of expertise |
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
bdc3e54
to
0af7ba0
Compare
@nextcloud/vuejs @skjnldsv Ping 🙂 |
@@ -153,6 +154,11 @@ export default { | |||
return new Date() | |||
}, | |||
}, | |||
|
|||
positionedParent: { |
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.
Please add documentation
Honestly, the amount of changes to this PR is humongous :( |
Well, humongous is a bit exaggerated. Neglacting whitespace changes, the PR "only" adds another |
Sorry, that's a bit exaggerated yes 🙈 |
This is the IMHO better but also more interfering solution to #998 than #1880 as it needs changes to AppSidebar and the datepicker library. In difference to #1880, the datepicker dropdown will not scroll with body.
In order to allow an absolutely positioned element (the datepicker) to overflow its ancestor although it has
overflow: hidden
set, the first positioned ancestor of the datepicker has to be an ancestor of the element withoverflow: hidden
as well (see https://css-tricks.com/popping-hidden-overflow/ for a bit of background and explanation).This means we have to adjust
AppSidebar
to look like this:Then the datepicker is positioned relative to
aside
and is allowed to overflowapp-sidebar-wrapper
. Since the datepicker library currently assumes that the datepicker isposition: relative;
it needs a fix to account for another element to be the first positioned ancestor. I have done this in https://github.com/raimund-schluessler/vue2-datepicker/commit/df040dbd5929f8f83f19390f396c924099ac7a38 and would send a PR to the datepicker library when we decide that this is a viable solution.The great thing is that the datepicker is not cut-off, all scrolling inside the AppSidebar still works and the datepicker is static when scrolling body (tested in Firefox and Chrome):
The changes to AppSidebar look more drastic than they actually are. I just added another div wrapping the AppSidebar, but this changes the indentation of all elements.
However, since the AppSidebar structure would change, custom adjustments maybe done by some apps might break (but should be fixable easily).