mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-17 12:47:30 +09:00
Bug 1397114 - Disable smooth scrolling when value changes come from input box
This commit is contained in:
parent
1cb68033a6
commit
def56bfceb
2 changed files with 8 additions and 19 deletions
|
|
@ -124,7 +124,7 @@ function DatePicker(context) {
|
|||
/**
|
||||
* Update date picker and its components.
|
||||
*/
|
||||
_update() {
|
||||
_update(options = {}) {
|
||||
const { dateKeeper, isMonthPickerVisible } = this.state;
|
||||
|
||||
if (isMonthPickerVisible) {
|
||||
|
|
@ -139,7 +139,8 @@ function DatePicker(context) {
|
|||
dateObj: dateKeeper.state.dateObj,
|
||||
months: this.state.months,
|
||||
years: this.state.years,
|
||||
toggleMonthPicker: this.state.toggleMonthPicker
|
||||
toggleMonthPicker: this.state.toggleMonthPicker,
|
||||
noSmoothScroll: options.noSmoothScroll
|
||||
});
|
||||
this.components.calendar.setProps({
|
||||
isVisible: !isMonthPickerVisible,
|
||||
|
|
@ -260,7 +261,7 @@ function DatePicker(context) {
|
|||
dateKeeper.setSelection({
|
||||
year, month, day
|
||||
});
|
||||
this._update();
|
||||
this._update({ noSmoothScroll: true });
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -330,14 +331,14 @@ function DatePicker(context) {
|
|||
items: props.months,
|
||||
isInfiniteScroll: true,
|
||||
isValueSet: this.state.isMonthSet,
|
||||
smoothScroll: !this.state.firstOpened
|
||||
smoothScroll: !(this.state.firstOpened || props.noSmoothScroll)
|
||||
});
|
||||
this.components.year.setState({
|
||||
value: props.dateObj.getUTCFullYear(),
|
||||
items: props.years,
|
||||
isInfiniteScroll: false,
|
||||
isValueSet: this.state.isYearSet,
|
||||
smoothScroll: !this.state.firstOpened
|
||||
smoothScroll: !(this.state.firstOpened || props.noSmoothScroll)
|
||||
});
|
||||
this.state.firstOpened = false;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue