Skip to content

[avatar] title attribute is inconsistent and depends on how properties are set #1629

@Peppe

Description

@Peppe

The title (tooltip) behaviour changes depending if you set the properties declaratively or programmatically.

If you set the following:

<vaadin-avatar name="Joan Doe" abbr="JD"></vaadin-avatar>

Then the title will be set to "Joan Doe" in:
https://github.com/vaadin/vaadin-avatar/blob/master/src/vaadin-avatar.js#L234

If you set the following

<vaadin-avatar></vaadin-avatar>
avatar.name='Joan Doe';
avatar.abbr="JD"

Then the title is "Joan Doe (JD)" due to https://github.com/vaadin/vaadin-avatar/blob/master/src/vaadin-avatar.js#L291. Notice the abbreviation in parenthesis, which was missing in the previous case.

It shouldn't matter which way I put the properties, the end result should always be same. Also if I start declaratively and update it later programmatically, then the behaviour changes in the middle.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions