You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2025/02/18 14:53:14 UTC
(myfaces-tobago) branch tobago-5.x updated: fix(badge): tc:badge renders tip attribute at wrong position
This is an automated email from the ASF dual-hosted git repository.
bommel pushed a commit to branch tobago-5.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/tobago-5.x by this push:
new 729019bb60 fix(badge): tc:badge renders tip attribute at wrong position
729019bb60 is described below
commit 729019bb6096ee5cca392c98a514ecb1a2ee349e
Author: Bernd Bohmann <bo...@apache.org>
AuthorDate: Tue Feb 18 15:03:08 2025 +0100
fix(badge): tc:badge renders tip attribute at wrong position
Issue: TOBAGO-2388
(cherry picked from commit aa30d6f0847a33ea5ccaf46af67b254ba5cfdeb1)
---
.../myfaces/tobago/internal/renderkit/renderer/BadgeRenderer.java | 2 +-
.../src/main/webapp/content/020-output/25-badge/Badge.xhtml | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeRenderer.java
index fb2315588d..ec3d190b30 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BadgeRenderer.java
@@ -50,10 +50,10 @@ public void encodeBeginInternal(final FacesContext facesContext, final T compone
isInside(facesContext, HtmlElements.TOBAGO_BUTTONS) ? BootstrapClass.BTN : null,
component.getCustomClass());
HtmlRendererUtils.writeDataAttributes(facesContext, writer, component);
- HtmlRendererUtils.encodeIconOrImage(writer, image);
if (tip != null) {
writer.writeAttribute(HtmlAttributes.TITLE, tip, true);
}
+ HtmlRendererUtils.encodeIconOrImage(writer, image);
if (value != null) {
writer.startElement(HtmlElements.SPAN);
writer.writeText(value);
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/020-output/25-badge/Badge.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/020-output/25-badge/Badge.xhtml
index 18d7f614e4..bb23890057 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/020-output/25-badge/Badge.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/020-output/25-badge/Badge.xhtml
@@ -59,10 +59,10 @@
<p/>
<tc:separator/>
- <p>Badges can have an icon.</p>
- <demo-highlight language="markup"><tc:badge value="image" image="#{request.contextPath}/image/feather-leaf.png"/>
+ <p>Badges can have an icon and tip.</p>
+ <demo-highlight language="markup"><tc:badge value="image" image="#{request.contextPath}/image/feather-leaf.png" tip="badge tip"/>
<tc:badge value="icon" image="bi-airplane"/></demo-highlight>
- <tc:badge value="image" image="#{request.contextPath}/image/feather-leaf.png"/>
+ <tc:badge value="image" image="#{request.contextPath}/image/feather-leaf.png" tip="badge tip"/>
<tc:badge value="icon" image="bi-airplane"/>
</tc:section>