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

fix(input-date-picker): provides placeholder text context for AT users #7320

Merged
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"chooseDate": "Choose date"
"chooseDate": "Choose date",
"dateFormat": "Date Format:"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"chooseDate": "Choose date"
"chooseDate": "Choose date",
"dateFormat": "Date Format:"
}
Original file line number Diff line number Diff line change
@@ -153,3 +153,7 @@
}

@include hidden-form-input();

.assistive-text {
@apply sr-only;
}
Original file line number Diff line number Diff line change
@@ -528,6 +528,7 @@ export class InputDatePicker
<calcite-input
aria-autocomplete="none"
aria-controls={this.dialogId}
aria-describedby={this.placeholderTextId}
aria-expanded={toAriaBoolean(this.open)}
aria-haspopup="dialog"
class={`input ${
@@ -550,6 +551,9 @@ export class InputDatePicker
ref={this.setStartInput}
/>
{this.renderToggleIcon(this.open && this.focusedInput === "start")}
<span aria-hidden="true" class={CSS.assistiveText} id={this.placeholderTextId}>
Date Format: {this.localeData?.placeholder}
Copy link
Member

Choose a reason for hiding this comment

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

This should be localized right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup, updated.

</span>
</div>
<div
aria-hidden={toAriaBoolean(!this.open)}
@@ -729,6 +733,8 @@ export class InputDatePicker

private valueAsDateChangedExternally = false;

private placeholderTextId = `calcite-input-date-picker-placeholder-${guid()}`;

//--------------------------------------------------------------------------
//
// Private Methods
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const CSS = {
assistiveText: "assistive-text",
menu: "menu-container",
menuActive: "menu-container--active",
toggleIcon: "toggle-icon"