Skip to content
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

Difference in parsing of props with or without src attribute #35

Closed
corstian opened this issue Jul 17, 2018 · 3 comments
Closed

Difference in parsing of props with or without src attribute #35

corstian opened this issue Jul 17, 2018 · 3 comments

Comments

@corstian
Copy link

With the following code:

<Avatar
    username="Corstian Boerman"
    inline size="30"
    class="mr-3"
    src="https://pbs.twimg.com/profile_images/940157009151721472/nVMbmnJf_400x400.jpg" />
Corstian Boerman
<br />
<br />
<Avatar
    username="Corstian Boerman"
    inline
    size="30"
    class="mr-3" />
Corstian Boerman

The result is quite different:

image

The layout of the last one is how I actually expect the avatar to render.

Looking at the styles applied to the element it seems that after the background image is set no other styles are being applied:

1st element:

<div
    class="vue-avatar--wrapper mr-3"
    style="
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: transparent url(&quot;https://pbs.twimg.com/profile_images/940157009151721472/nVMbmnJf_400x400.jpg&quot;) no-repeat scroll 0% 0% / 30px 30px content-box border-box;
    ">
    <!---->
</div>

2nd element:

<div
    class="vue-avatar--wrapper mr-3"
    style="
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background-color: rgb(158, 158, 158);
        font: 12px/301px Helvetica, Arial, sans-serif;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: rgb(238, 238, 238);
    ">
    <span>CB</span>
</div>
@saintplay
Copy link
Collaborator

I can see why there is a inconsistency in the layout. But answering your question, using the src prop, the username prop is ignored

@corstian
Copy link
Author

corstian commented Jul 20, 2018

Yeah, but given that the username prop is mandatory I can't do much without it.

Do you have some time to fix the inconsistency, or point me in general direction so I can fix it myself?

Edit: Does not look too difficult. I'll try to fix it when I have some spare time again.

@saintplay
Copy link
Collaborator

v2.1.6 should fix this inconsistency, username prop is not longer required to use an image

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

No branches or pull requests

2 participants