Skip to content

Conversation

@siddharthkp
Copy link
Member

@siddharthkp siddharthkp commented Sep 9, 2021

Describe your changes here.

Closes #1405

Screenshots

before:
image
after:
image

Worth mentioning

I've made alt text optional based on @alliethu's comment. We set the default value to "" (empty string) so that screen readers ignore it.

Room for improvement

  1. The default value for alt shows up as - even though the value is an empty string. This is because we set savePropValueAsString which treats undefined and "" the same. It would be interesting to show an explicit empty string as null and empty string have different meaning for alt (reference via @alliethu, thx! 👋 )
  2. Right now, we don't indicate a prop is required, it would be really nice to have that.
  3. The order of props in the documentation is not the same as the order they are defined. It would be nice to control the order

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@siddharthkp siddharthkp requested a review from a team September 9, 2021 17:59
@changeset-bot
Copy link

changeset-bot bot commented Sep 9, 2021

⚠️ No Changeset found

Latest commit: 9ab233c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2021

size-limit report 📦

Path Size
dist/browser.esm.js 48.59 KB (0%)
dist/browser.umd.js 48.85 KB (0%)

@alliethu
Copy link

alliethu commented Sep 9, 2021

The default value for alt shows up as - even though the value is an empty string.

@siddharthkp Is this alt update in a place I can access it and run through it with a ScreenReader? I'm a little concerned the output value being -, might not be accessible to SR users.

@siddharthkp
Copy link
Member Author

siddharthkp commented Sep 9, 2021

@siddharthkp Is this alt update in a place I can access it and run through it with a ScreenReader? I'm a little concerned the output value being -, might not be accessible to SR users.

Hi @alliethu!

Whoops, bad choice of words on my side! The rendered alt text is still an empty string by default (didn't change that). However, we show the wrong value in the documentation (- instead of empty string)

The preview is deployed here: preview/Avatar

image

The rendered alt text is an empty string:

image

@alliethu
Copy link

alliethu commented Sep 9, 2021

@siddharthkp Perfect! Thank you for clarifying!! 🙇🏼‍♀️

Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks for doing this, @siddharthkp! ✨

I agree with all of the things you listed in Room for improvement. Do you want to open up PRs for those next?

Co-authored-by: Cole Bemis <colebemis@github.com>
@siddharthkp
Copy link
Member Author

I agree with all of the things you listed in Room for improvement. Do you want to open up PRs for those next?

Sounds good 👍

What's our merge process, do I just merge this when the build passes?

@colebemis
Copy link
Contributor

What's our merge process, do I just merge this when the build passes?

Yeah, go ahead and merge it 🚢

@siddharthkp siddharthkp merged commit b2611b6 into main Sep 10, 2021
@siddharthkp siddharthkp deleted the sid/avatar-add-common-props branch September 10, 2021 14:09
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

Successfully merging this pull request may close these issues.

Avatar: document src and alt props

4 participants