diff options
Diffstat (limited to 'packages/anastasis-webui/src/components/picker/DatePicker.tsx')
-rw-r--r-- | packages/anastasis-webui/src/components/picker/DatePicker.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/anastasis-webui/src/components/picker/DatePicker.tsx b/packages/anastasis-webui/src/components/picker/DatePicker.tsx index e51b3db68..5b33fa8be 100644 --- a/packages/anastasis-webui/src/components/picker/DatePicker.tsx +++ b/packages/anastasis-webui/src/components/picker/DatePicker.tsx @@ -24,6 +24,7 @@ import { h, Component } from "preact"; interface Props { closeFunction?: () => void; dateReceiver?: (d: Date) => void; + years?: Array<number>; opened?: boolean; } interface State { @@ -207,9 +208,9 @@ export class DatePicker extends Component<Props, State> { } componentDidUpdate() { - if (this.state.selectYearMode) { - document.getElementsByClassName('selected')[0].scrollIntoView(); // works in every browser incl. IE, replace with scrollIntoViewIfNeeded when browsers support it - } + // if (this.state.selectYearMode) { + // document.getElementsByClassName('selected')[0].scrollIntoView(); // works in every browser incl. IE, replace with scrollIntoViewIfNeeded when browsers support it + // } } constructor() { @@ -296,8 +297,7 @@ export class DatePicker extends Component<Props, State> { </div>} {selectYearMode && <div class="datePicker--selectYear"> - - {yearArr.map(year => ( + {(this.props.years || yearArr).map(year => ( <span key={year} class={(year === displayedYear) ? 'selected' : ''} onClick={this.changeDisplayedYear}> {year} </span> |