Skip to content

Enhance icon rendering in Menu widget to support custom tag.#94

Open
terabytesoftw wants to merge 16 commits intomasterfrom
add-support-menu-widget-custom-tag-icon
Open

Enhance icon rendering in Menu widget to support custom tag.#94
terabytesoftw wants to merge 16 commits intomasterfrom
add-support-menu-widget-custom-tag-icon

Conversation

@terabytesoftw
Copy link
Copy Markdown
Member

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

@terabytesoftw terabytesoftw linked an issue May 4, 2025 that may be closed by this pull request
@terabytesoftw terabytesoftw requested a review from a team May 4, 2025 11:34
@terabytesoftw terabytesoftw added the status:code review The pull request needs review. label May 4, 2025
Comment thread src/Helper/Normalizer.php Outdated
Comment thread src/Helper/Normalizer.php Outdated
Comment thread src/Helper/Normalizer.php Outdated
Comment thread src/Menu.php Outdated
@samdark samdark requested a review from vjik May 6, 2025 17:20
Comment thread src/Helper/Normalizer.php
$html = Span::tag()->attributes($iconContainerAttributes)->content($i)->encode(false)->render();
$html = Html::tag($tagName)->attributes($iconAttributes)->content($icon)->render();

if ($tagName === 'i') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapping usage that depends from tag name is very unexpected.

This package contains common framework-agnostic widgets, so result should be defined clearly. Use container or not, should be defined clearly and not depend from tag name.

Copy link
Copy Markdown
Member Author

@terabytesoftw terabytesoftw May 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is about the handling of icons, which are usually wrapped in a container, while SVGs, for example, are not wrapped, just like an image. But i understand the proposal, i will improve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Menu widget item icon doesn't support img tag

4 participants