-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix incorrect VO for selected check-in date #1451
Fix incorrect VO for selected check-in date #1451
Conversation
@majapw Can you take a look at this? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the conditional can be simplified a bit. :)
src/utils/getCalendarDaySettings.js
Outdated
if (modifiers.has(BLOCKED_MODIFIER)) { | ||
if (modifiers.has(BLOCKED_MODIFIER) && selected) { | ||
ariaLabel = getPhrase(dateIsSelected, formattedDate); | ||
} else if (modifiers.has(BLOCKED_MODIFIER)) { | ||
ariaLabel = getPhrase(dateIsUnavailable, formattedDate); | ||
} else if (selected) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to just move the if(selected)
condition to be fire? e.g.
if (selected) {
ariaLabel = getPhrase(dateIsSelected, formattedDate);
} else if (modifiers.has(BLOCKED_MODIFIER)) {
ariaLabel = getPhrase(dateIsUnavailable, formattedDate);
} else ...
f362968
to
b0e86b7
Compare
@majapw PTAL! Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
This PR fixes an accessibility bug where VO incorrectly defines a selected check-in date in calendar as unavailable. This is fixed by checking if the day is both blocked and selected, and if this is true the phrase should be
dateIsSelected
.