Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[TwigComponent][Icons] Inconsistency between allowed attributes #2148

Closed
norkunas opened this issue Sep 11, 2024 · 5 comments · Fixed by #2149
Closed

[TwigComponent][Icons] Inconsistency between allowed attributes #2148

norkunas opened this issue Sep 11, 2024 · 5 comments · Fixed by #2149

Comments

@norkunas
Copy link
Contributor

Twig components allows to provide an integer as attibute values and casts it, while UX:Icon doesn't allow it.

Valid example:

<twig:Test a="1" b="{{ 2 }}">
  test
</twig:Test>

Currently invalid:

<twig:UX:Icon a="1" b="{{ 2 }}" />
@smnandre
Copy link
Collaborator

I'm curious to know the real problem behind this (factual) observation ?

What did you want to do here you could not ?

@norkunas
Copy link
Contributor Author

I was switching from custom icon component. In one twig component I had a loop where icon's are rendered and then binding {{ loop.index0 }} via data attribute and this is where the problem appear. Had to do {{ '' ~ loop.index0 }}.

So this was an expectation error, where you can write numbers to attributes via twig component and so <twig:UX:Icon /> looks like a twig component with some exceptions :)

@smnandre
Copy link
Collaborator

Let's add this :)

@smnandre
Copy link
Collaborator

Does this fix from @Kocal solve all your use cases ?

#2149

@norkunas
Copy link
Contributor Author

Yup

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants