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

MSFT-240 #305

Open
wants to merge 3 commits into
base: qa-accessibility
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/scripts/tc/register.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ import { getNewJWT } from '../../../core/auth.js'
}, 100);
}

// A hack to make input field compatible with screen readers
vm.countryDefaultPlaceholder = 'Country'
vm.countryPlaceholder = vm.countryDefaultPlaceholder

vm.clearCountryPlaceholder = function() {
vm.countryPlaceholder = ''
}

vm.setCountryPlaceholder = function () {
vm.countryPlaceholder = vm.countryDefaultPlaceholder
}

vm.updateCountry = function (angucompleteCountryObj) {
var countryCode = _.get(angucompleteCountryObj, 'originalObject.code', undefined)

Expand Down
2 changes: 1 addition & 1 deletion app/views/tc/login.jade
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

div.validation-bar(ng-class="{'error-bar': vm.loginErrors.USERNAME_NONEXISTANT}")
label(for="username") USERNAME OR EMAIL
input(ng-model="vm.username", id="username", placeholder="Username or Email", type="text", required, aria-invalid="false")
input(ng-model="vm.username", id="username", placeholder="Username or Email", aria-label="Username of Email", onblur="this.placeholder='Username or Email'", onfocus="this.placeholder=''", type="text", required, aria-invalid="false")

toggle-password

Expand Down
12 changes: 7 additions & 5 deletions app/views/tc/register.jade
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@
.first-last-names
input-sticky-placeholder(sticky-placeholder="First", ng-model="vm.firstname")
label(for="firstname") First Name
input(ng-model="vm.firstname", maxlength="64", id="firstname", name="firstname", placeholder="First Name", type="text", required)
input(ng-model="vm.firstname", maxlength="64", name="firstname", id="firstname", aria-label="First Name", aria-invalid="false", onblur="this.placeholder='First Name'", onfocus="this.placeholder=''", placeholder="First Name", type="text", required)

input-sticky-placeholder(sticky-placeholder="Last", ng-model="vm.lastname")
label(for="lastname") Last Name
input(ng-model="vm.lastname", maxlength="64", id="lastname", name="lastname", placeholder="Last Name", type="text", required)
input(ng-model="vm.lastname", maxlength="64", id="lastname", name="lastname", aria-label="Last Name", aria-invalid="false", onblur="this.placeholder='Last Name'", onfocus="this.placeholder=''", placeholder="Last Name", type="text", required)

.country-dropdown#country
label(for="country") Country
.country-dropdown(aria-label="Country")
label(for="_value") Country
angucomplete-alt(
input-name="country",
placeholder="Country",
placeholder="{{vm.countryPlaceholder}}",
focus-in="vm.clearCountryPlaceholder()"
focus-out="vm.setCountryPlaceholder()"
pause="100",
selected-object="vm.updateCountry",
local-data="vm.countries",
Expand Down