Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[JS] Only assign img alt text if it's supplied#4010

Merged
paulcam206 merged 3 commits into
masterfrom
paulcam/img-alt-undefined-string
May 15, 2020
Merged

[JS] Only assign img alt text if it's supplied#4010
paulcam206 merged 3 commits into
masterfrom
paulcam/img-alt-undefined-string

Conversation

@paulcam206

@paulcam206 paulcam206 commented May 13, 2020

Copy link
Copy Markdown
Member

Related Issue

Fixes #2235

Description

When a card author fails to supply alt text, we actually create an img element with the alt text set to "undefined" rather than not set the property in the first place.

How Verified

How you verified the fix, including one or all of the following:

  1. New unit test
  2. Local repro and inspection with F12 tools
Microsoft Reviewers: Open in CodeFlow

@ghost

ghost commented May 13, 2020

Copy link
Copy Markdown

Hi @paulcam206. Thanks for helping make the AdaptiveCards JS renderer + tooling better. As additional verification, once the JS build succeeds, please go to the test site to test out your website/designer changes.

@paulcam206 paulcam206 requested a review from dclaux May 13, 2020 16:58
@paulcam206 paulcam206 added the Platform-JavaScript Bugs or features related to the JavaScript renderer label May 13, 2020
@paulcam206

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@shalinijoshi19 shalinijoshi19 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Something we should consider backporting to release/1.2 and potentially prep for an AdaptiveCards v1.2.9 patch.. Thoughts?

test('Image should be instantiated', ()=>{
const image = new Image();
expect(image).toEqual(expect.anything());
expect(image.altText).toBeUndefined();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I know you were working on more comprehensive UTs for the platform.. so potentially some coming up which actually test the altText flowing through if specified/not undefined?

@shalinijoshi19 shalinijoshi19 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

:shipit:

@paulcam206

Copy link
Copy Markdown
Member Author

Something we should consider backporting to release/1.2 and potentially prep for an AdaptiveCards v1.2.9 patch.. Thoughts?

Should be easy enough (though it'll likely be a manual port rather than a cherry-pick).

@paulcam206

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@paulcam206 paulcam206 merged commit 5bc63de into master May 15, 2020
@paulcam206 paulcam206 deleted the paulcam/img-alt-undefined-string branch May 15, 2020 19:16
@shalinijoshi19 shalinijoshi19 added the Area-Accessibility Bugs around feature accessibility label May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Accessibility Bugs around feature accessibility Platform-JavaScript Bugs or features related to the JavaScript renderer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Name/ Alt-text property is not proprly defined for Images.

2 participants