Fix picker sometimes not retaining max height

master
Vitaliy Filippov 2021-11-17 13:04:45 +03:00
parent d155becf23
commit 37d694e183
1 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@
// ...Or maybe a button with a popup menu
// License: LGPLv3.0+
// (c) Vitaliy Filippov 2019+
// Version 2021-10-07
// Version 2021-11-17
import React from 'react';
import ReactDOM from 'react-dom';
@ -216,15 +216,15 @@ export default class Picker extends React.Component
? ReactDOM.findDOMNode(this.input).getBoundingClientRect()
: { left: this.props.popupX||0, top: this.props.popupY||0 };
const pos = Picker.calculatePopupPosition(inputRect, this.picker, this.props);
if (ph && ph != 'auto')
{
this.picker.style.height = ph;
}
if (this.state.top !== pos.top || this.state.left !== pos.left ||
this.state.width !== pos.width || this.state.height !== pos.height)
{
this.setState(pos);
}
else if (ph)
{
this.picker.style.height = ph;
}
}
static getScrollHeight(el)