Skip to content

SLDSDatePicker bug fix: Fixing issue where year picker doesn't show years correctly #1505

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

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ exports[`Datepicker
>
<div
className="slds-datepicker__filter--month slds-grid slds-grid--align-spread slds-grow"
style={
Object {
"flex": 1.75,
}
}
>
<div
className="slds-align-middle"
Expand Down Expand Up @@ -922,6 +927,11 @@ exports[`Datepicker
>
<div
className="slds-datepicker__filter--month slds-grid slds-grid--align-spread slds-grow"
style={
Object {
"flex": 1.75,
}
}
>
<div
className="slds-align-middle"
Expand Down Expand Up @@ -1767,6 +1777,11 @@ exports[`Datepicker Default DOM Snapshot 1`] = `
>
<div
className="slds-datepicker__filter--month slds-grid slds-grid--align-spread slds-grow"
style={
Object {
"flex": 1.75,
}
}
>
<div
className="slds-align-middle"
Expand Down Expand Up @@ -2560,7 +2575,7 @@ exports[`Datepicker Default HTML Snapshot 1`] = `
<div class=\\"slds-datepicker slds-dropdown slds-dropdown--left\\">
<div class=\\"\\" aria-hidden=\\"false\\" data-selection=\\"single\\">
<div class=\\"slds-datepicker__filter slds-grid\\">
<div class=\\"slds-datepicker__filter--month slds-grid slds-grid--align-spread slds-grow\\">
<div class=\\"slds-datepicker__filter--month slds-grid slds-grid--align-spread slds-grow\\" style=\\"flex:1.75;\\">
<div class=\\"slds-align-middle\\"><button class=\\"slds-button slds-button--icon-container\\" type=\\"button\\"><svg aria-hidden=\\"true\\" class=\\"slds-button__icon\\"><use xlink:href=\\"/assets/icons/utility-sprite/svg/symbols.svg#left\\"></use></svg><span class=\\"slds-assistive-text\\">Previous month</span></button></div>
<h2
id=\\"sample-datepicker-month\\" class=\\"slds-align-middle\\" aria-live=\\"assertive\\" aria-atomic=\\"true\\">July <span class=\\"slds-assistive-text\\">2014</span></h2>
Expand Down
5 changes: 4 additions & 1 deletion components/date-picker/private/navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ const DatepickerMonthNavigation = createReactClass({
render () {
return (
<div className="slds-datepicker__filter slds-grid">
<div className="slds-datepicker__filter--month slds-grid slds-grid--align-spread slds-grow">
<div
className="slds-datepicker__filter--month slds-grid slds-grid--align-spread slds-grow"
style={{ flex: 1.75 }}
>
<div className="slds-align-middle">
<Button
assistiveText={{ icon: this.props.assistiveTextPreviousMonth }}
Expand Down
3 changes: 2 additions & 1 deletion components/date-picker/private/year-picklist.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const DatepickerYearSelector = createReactClass({
const opts = [];

for (let year = fromYear; year < toYear; year += 1) {
opts.push({ label: `${year}`, value: year, id: opts.length });
opts.push({ label: `${year}`, value: year, id: String(opts.length) });
Copy link
Contributor

@interactivellama interactivellama Aug 16, 2018

Choose a reason for hiding this comment

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

I just saw this today! I didn't catch it when I updated the Combobox props. Thanks

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, cool - no worries :)

}
return opts;
},
Expand Down Expand Up @@ -73,6 +73,7 @@ const DatepickerYearSelector = createReactClass({
<div className="slds-form-element slds-align-content-center">
<Combobox
className="slds-shrink-none"
classNameMenu="slds-datepicker"
events={{
onSelect: this.handleSelect,
}}
Expand Down