TatuLund / badge

Simple Java API for Lumo Badges
Other
0 stars 0 forks source link

Setting the text of badge, adds another instance of span with the new value #3

Closed HerbertsVaadin closed 1 year ago

HerbertsVaadin commented 1 year ago

In version 2.2.2 (V23 branch)

    /**
     * Set the text content of the badge, remove all other content.
     * 
     * @param text
     *            String value.
     */
    public void setText(String text) {
        this.text = text;
        add(new Span(text));
    }

Doesn't remove old content as stated in javadoc, so we just get more spans and texts added every time we call badge.setText(..).

image

TatuLund commented 1 year ago

Good catch.

TatuLund commented 1 year ago

Fixed in 2.2.3 / 2.30