Closed ybbus closed 6 months ago
This restrictions has been added to allow the Patcher
to potentially handle class()
calls differently in future, e.g. to map them directly classList
manipulations (without the need to parse the given argument).
If you ignore the assertion, your code might fail in future versions of UI5.
But there's an alternative: the RenderManager meanwhile allows to use the attr()
method also for class and style attributes. You just must not mix the two approaches for a single element. If you use attr("class", someClassList)
, you must not use class(someClass)
for the same element, same for attr("style", someStyles)
and style(someStyle, someStyleValue)
.
OpenUI5 version: 1.120.6
Steps to reproduce the problem:
What is the expected result? Works without complaint.
What happens instead?
Assertion failed: Method 'class' must be called with exactly one class name
Any other information?
Why is there an assertion for that? It works anyway as expected even so assertion fails. We are working heavily with tailwind on custom components and beeing able to only provide one class per ´´´class()´´´ call would be a nightmare. :)