NcAppSidebar: fix tabs with css icon #4111
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves
This PR resolves two different problems in
NcSidebarTab
with CSS icon. I combined them together into 1 PR because they both required to be fixed to resolve the problem.1. Resolves rendering by
OCA.Files.Sidebar
Fixes: nextcloud/server#38229
Regression of: #3891
The icon is rendered by
NcAppSidebarTab.renderIcon()
inNcAppSidebarTabs
. It seems to me when it is used withOCA.Files.Sidebar
(and maybeLegacyView
),Tabs
andTab
components are rendered by different Vue copies on the page (on my instance 24 different copies of Vue are bundled).As a result, when
NcAppSidebarTab.renderIcon()
is called inNcAppSidebarTabs
's rendering, it doesn't know about the rendering.NcAppSidebarTab.renderIcon()
createsVNode
in one Vue copy, but is used in rendering in another Vue copy. It fails, because forNcAppSidebarTab.renderIcon()
there is no rendering in the first Vue copy.In this PR rendering of the icon is simplified.
NcAppSIdebarTab.renderIcon()
is used ONLY to render the slot's icon. CSS icon is rendered byNcSidebarTabs
directly as a fallback. Then it works fine in different contexts.P.S. To fix the mentioned issue this PR should be manually backported: #4112
2. Resolves losing CSS icon
Fixes the problem that causes the problem fixed in: nextcloud/activity#1154
Also fix: nextcloud/activity#1167
Regression of: #3945
During the update to the new design with
NcCheckboxRadioSwitch
, styles for CSS icons were lost. Span with CSS icon had width 0.This PR returns the styles with the default size 20px as used in
NcCheckboxRadioSwitch
.