BranchMetrics / web-branch-deep-linking-attribution

The Branch Web SDK for deep linking and attribution. Once initialized, the Branch Web SDK allows you to create and share links with a banner (web only), over SMS, or your own methods by generating deep links. It also offers event tracking, access to referrals, and management of credits.
https://help.branch.io/developers-hub/docs/web-sdk-overview
MIT License
287 stars 100 forks source link

[BUX-1856] Visual label of CTA is the same as the programmatical name. #867

Closed hana-branch closed 1 year ago

hana-branch commented 1 year ago

Pull Request Template

Description

To improve the Journeys Accessibility Audit WCAG 2.1, changed that the visual label of a CTA is the same as the programmatical name.

Fixes # BUX-1856

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

JS Budget Check

Please mention the size in kb before and after this PR

Files Before After
dist/build.js. 164 KB 164 KB
dist/build.min.js 74 KB 74 KB

Checklist:

Mentions:

List the person or team responsible for reviewing proposed changes.

cc @BranchMetrics/saas-sdk-devs for visibility.

JagadeeshKaricherla-branch commented 1 year ago

@hana-branch : aria-label can be set inside addDynamicCtaText method itself. Dont need to repeat the code in a new method.

journeys_utils.addDynamicCtaText = function (iframe, ctaText) {
    var doc = iframe.contentWindow.document;
    if (doc && doc.getElementById('branch-mobile-action')) {
        var mobileAction = doc.getElementById('branch-mobile-action');
        mobileAction.innerHTML = ctaText;
        mobileAction.setAttribute('aria-label', ctaText);
    }
}
hana-branch commented 1 year ago

@JagadeeshKaricherla-branch Thanks for reviewing this, I just changed the code based on your feedback, could you please re-review the change? thanks