You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2021/06/02 12:28:56 UTC
[myfaces-tobago] branch master updated: fix(dropdown): styling
This is an automated email from the ASF dual-hosted git repository.
hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/master by this push:
new 4ab0f7f fix(dropdown): styling
4ab0f7f is described below
commit 4ab0f7f7d7163ac6e2299ed9a2a561c920c2b4f9
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Wed Jun 2 14:17:19 2021 +0200
fix(dropdown): styling
The "nav-link" class must not set in dropdown menus.
It result in wrong spacing for dropdown entries.
* test adjusted
---
.../myfaces/tobago/internal/renderkit/renderer/CommandRendererBase.java | 2 +-
.../src/test/resources/renderer/links/link-inside-links-sub.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/CommandRendererBase.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/CommandRendererBase.java
index beed980..d109f19 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/CommandRendererBase.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/CommandRendererBase.java
@@ -123,7 +123,7 @@ public abstract class CommandRendererBase<T extends AbstractUICommand> extends D
dropdownSubmenu ? BootstrapClass.DROPDOWN_ITEM : null,
parentOfCommands && !dropdownSubmenu ? BootstrapClass.DROPDOWN_TOGGLE : null,
component.getCustomClass(),
- isInside(facesContext, HtmlElements.TOBAGO_LINKS) ? BootstrapClass.NAV_LINK : null);
+ isInside(facesContext, HtmlElements.TOBAGO_LINKS) && !dropdownSubmenu ? BootstrapClass.NAV_LINK : null);
final boolean defaultCommand = ComponentUtils.getBooleanAttribute(component, Attributes.defaultCommand);
if (defaultCommand) {
diff --git a/tobago-core/src/test/resources/renderer/links/link-inside-links-sub.html b/tobago-core/src/test/resources/renderer/links/link-inside-links-sub.html
index 2d77b03..ed11124 100644
--- a/tobago-core/src/test/resources/renderer/links/link-inside-links-sub.html
+++ b/tobago-core/src/test/resources/renderer/links/link-inside-links-sub.html
@@ -23,7 +23,7 @@ CSS class nav-item has moved from "tobago-dropdown" to "li"
<tobago-dropdown id='id' class='dropdown'>
<button type='button' id='id::command' name='id' data-bs-toggle='dropdown' aria-expanded='false' class='tobago-link btn btn-link dropdown-toggle nav-link'><tobago-behavior event='click' client-id='id' field-id='id::command'></tobago-behavior><span>apache</span></button>
<div class='dropdown-menu' aria-labelledby='id::command' name='id'>
- <a id='sub' name='sub' href='https://www.apache.org/' class='tobago-link dropdown-item nav-link'><tobago-behavior event='click' client-id='sub' omit='omit'></tobago-behavior><span>sub</span></a>
+ <a id='sub' name='sub' href='https://www.apache.org/' class='tobago-link dropdown-item'><tobago-behavior event='click' client-id='sub' omit='omit'></tobago-behavior><span>sub</span></a>
</div>
</tobago-dropdown>
</li>