-
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
fix(NcAppNavigation): Wrap app navigation default slot with scrollable container #5347
Conversation
34d43d7
to
acb55e4
Compare
<div v-if="$scopedSlots.default" class="app-navigation__body"> | ||
<slot /> | ||
</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.
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.
$slots
will work here in Vue 2 as well as double-render with isSlotPopupated()
in Vue 3
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
With the default slot, it is always more complicated. If short syntax (not
<template #default>
) is used, then the slot is passed. Even it is actually empty with empty strings from the template.
In this case it seems to not be an empty string but rather a modal https://github.com/nextcloud/server/blob/c18ffe0cad13dc5903cbb08ffbdb787f01db5e35/apps/files/src/views/Navigation.vue#L71-L73 that is causing this 🤔
Not sure how we could resolve this on nc/vue side, any ideas?
And because of flex, it is stretched by default:
How can I repro this?
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.
In this case it seems to not be an empty string but rather a modal https://github.com/nextcloud/server/blob/c18ffe0cad13dc5903cbb08ffbdb787f01db5e35/apps/files/src/views/Navigation.vue#L71-L73 that is causing this 🤔
Yes, but the same issue would be in other cases. Anything in components's content, even if it actually is not rendered, cause this issue. With the default slot it's always more annoying...
Not sure how we could resolve this on nc/vue side, any ideas?
Let me have a look on the issue...
How can I repro this?
I though that was on this branch + your branch on server for the same issue. Be let me double check.
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.
And because of flex, it is stretched by default:
How can I repro this?
Ok, it seems to work fine now on your branch.
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.
seems to good ;) thank you!
Pushed a Only one place https://github.com/nextcloud/server/blob/c18ffe0cad13dc5903cbb08ffbdb787f01db5e35/apps/files/src/views/Navigation.vue#L71-L73 would need to be adjusted |
88be19b
to
43fe184
Compare
…e container Signed-off-by: Christopher Ng <[email protected]>
43fe184
to
19e7f64
Compare
Should be also tested with Talk |
💀💀 we'll need to find a solution without using default slot then I think then we should add a new slot for this specific use-case instead of changing default slot behaviour, what do you think @ShGKme? |
I'd not add a new slot here. A new slot means — +4 cases to support in the component (combination with other slots) and a new interface — so no revert without a breaking change.
I think, using the default slot is fine. The problem is probably mixing some styles between We can try to keep |
☑️ Resolves
div.app-navigation__body
now fills the height withheight: 100%
&:nth-last-of-type(2)
fill stylesheight: fit-content
in all contexts and is itself not scrollable now that scrolling is delegated to the container similar to theul.app-navigation__list
list slot behaviour🖼️ Screenshots
🏁 Checklist
next
requested with a Vue 3 upgrade