Fix animation on deferred load
parent
5b527ee5e1
commit
61ae0aea15
|
@ -1,5 +1,5 @@
|
||||||
// Menu-like Picker variant with keyboard control
|
// Menu-like Picker variant with keyboard control
|
||||||
// Version 2020-06-30
|
// Version 2021-08-20
|
||||||
// License: LGPLv3.0+
|
// License: LGPLv3.0+
|
||||||
// (c) Vitaliy Filippov 2020+
|
// (c) Vitaliy Filippov 2020+
|
||||||
|
|
||||||
|
@ -115,7 +115,12 @@ export default class PickerMenu extends Picker
|
||||||
anim(() =>
|
anim(() =>
|
||||||
{
|
{
|
||||||
e.style.maxHeight = '100%';
|
e.style.maxHeight = '100%';
|
||||||
const end = () => { e.style.overflowY = 'auto'; e.removeEventListener('transitionend', end); };
|
const end = () =>
|
||||||
|
{
|
||||||
|
e.style.maxHeight = 'none';
|
||||||
|
e.style.overflowY = 'auto';
|
||||||
|
e.removeEventListener('transitionend', end);
|
||||||
|
};
|
||||||
e.addEventListener('transitionend', end);
|
e.addEventListener('transitionend', end);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -125,6 +130,10 @@ export default class PickerMenu extends Picker
|
||||||
renderPicker = () =>
|
renderPicker = () =>
|
||||||
{
|
{
|
||||||
const theme = this.props.theme || autocomplete_css;
|
const theme = this.props.theme || autocomplete_css;
|
||||||
|
if (!this.props.beforeItems && !this.props.items.length && !this.props.afterItems)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return (<div ref={this.animatePicker}
|
return (<div ref={this.animatePicker}
|
||||||
tabIndex={!this.props.renderInput ? 1 : undefined}
|
tabIndex={!this.props.renderInput ? 1 : undefined}
|
||||||
className={theme.suggestions}
|
className={theme.suggestions}
|
||||||
|
|
Loading…
Reference in New Issue