Uh oh!
There was an error while loading. Please reload this page.
feat: Add alt prop to Image component - #34550
Conversation
Base commit: 8cdc9e7 |
Base commit: 8cdc9e7 |
ryancat
commented
Sep 1, 2022
It's tricky, but I think we should do it. Pros:
Cons:
|
Uh oh!
There was an error while loading. Please reload this page.
necolas
commented
Sep 1, 2022
At this stage, I don't think we need to display the alt text if the image doesn't load. Often on web we try to prevent broken images breaking layout by hiding fallback text anyway. This is what RNWeb does today. We can always revisit this decision in the future once people start using it and if a case is made. |
bbd6b3e to
d6e24d9Comparenecolas
commented
Sep 6, 2022
Ping @cipolleschi or @jacdebug to import |
34db210 to
2490538Comparegabrieldonadel
commented
Sep 8, 2022
Could someone please import this? @cipolleschi@NickGerleman@jacdebug@ryancat |
53027c8 to
f551198Comparefacebook-github-bot
commented
Sep 19, 2022
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
lunaleaps
left a comment
There was a problem hiding this comment.
Can we also update the TS types?
f551198 to
44da077Comparegabrieldonadel
commented
Sep 19, 2022
Sure, I've just updated it |
necolas
commented
Sep 20, 2022
The TS types are already out of sync with the Flow types, as they don't have props from the other merged Web PRs |
I'm actively updating them to catch up (like the accessibility, id ones) and for going forward, we can keep them up to date. |
Summary: While working on #34550 I noticed that a couple of words inside the RNTester package were misspelled, this gave me the idea to test other files as well using the VS Code extension [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) which unveiled quite a few other typos. ## Changelog [Internal] [Fixed] - Fix RNTester typos Pull Request resolved: #34757 Test Plan: Shouldn't require much testing as this is just fixing some typos inside the RNTester package. Reviewed By: dmytrorykun Differential Revision: D39722889 Pulled By: cortinico fbshipit-source-id: a575ab8337586c5fe2d68ce73d2aae27d24a6384
cipolleschi
commented
Sep 22, 2022
Hi @gabrieldonadel could you please fix the linting warning? After that I'll reimport this. ;) |
gabrieldonadel
commented
Sep 22, 2022
Sure thing, you're talking about these lint warnings that the github-actions bot commented, right? |
gabrieldonadel
commented
Sep 22, 2022
@cipolleschi I've pushed a commit fixing all warnings |
facebook-github-bot
commented
Sep 23, 2022
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
facebook-github-bot
commented
Sep 26, 2022
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
c467683 to
989d8d8Comparefacebook-github-bot
commented
Sep 27, 2022
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
react-native-bot
commented
Sep 27, 2022
This pull request was successfully merged by @gabrieldonadel in 71fda5e. When will my fix make it into a release? | Upcoming Releases |
Summary
This adds the
altprop to theImagecomponent as requested on #34424. Using this newaltprop enables theaccessibilityprop and passes down the alt text toaccessibilityLabel. This PR also updates RNTester ImageExample in order to facilitate the manual QA.Open questions
On webNot for nowalttext is displayed on the page if the image can't be loaded for some reason, should we implement this same behavior if theImagecomponent fails to loadsource?Changelog
[General] [Added] - Add alt prop to Image component
Test Plan
altprop through theAccessibility Label via alt propsection, this can be tested either by enabling Voice Over if you're using a real device or through the Accessibility Inspector if you're using a simulatorScreen.Recording.2022-08-31.at.18.41.15.mov