Fix animation on deferred load

master
Vitaliy Filippov 2021-08-20 00:48:12 +03:00
parent 5b527ee5e1
commit 61ae0aea15
1 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,5 @@
// Menu-like Picker variant with keyboard control
// Version 2020-06-30
// Version 2021-08-20
// License: LGPLv3.0+
// (c) Vitaliy Filippov 2020+
@ -115,7 +115,12 @@ export default class PickerMenu extends Picker
anim(() =>
{
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);
});
});
@ -125,6 +130,10 @@ export default class PickerMenu extends Picker
renderPicker = () =>
{
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}
tabIndex={!this.props.renderInput ? 1 : undefined}
className={theme.suggestions}