Skip to content

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

New issue

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

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

Already on GitHub? Sign in to your account

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
Member

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
Member

Let's add this :)

@smnandre
Copy link
Member

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

#2149

@norkunas
Copy link
Contributor Author

Yup

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

Successfully merging a pull request may close this issue.

4 participants