oωo (owo-lib)

oωo (owo-lib)

17M Downloads

owo-ui: Data-driven text box trims preset text to the default limit, even when a max-length is set

anonymous123-code opened this issue · 1 comments

commented

For example the text of

<text-box>
    <max-length>300</max-length>
    <text>This is an example text longer than 32 chars, which is the default limit</text>
</text-box>

will get trimmed to This is an example text longer t

This happens because at

super.parseProperties(spec, element, children);
UIParsing.apply(children, "text", e -> e.getTextContent().strip(), this::text);
UIParsing.apply(children, "show-background", UIParsing::parseBool, this::setDrawsBackground);
UIParsing.apply(children, "max-length", UIParsing::parseUnsignedInt, this::setMaxLength);

the text is set before the maximum length and the text setter trims the text if it is to long.

commented

Thanks for reporting, this has been fixed in 0.10.3