Do not stick picker to the right edge if it is too wide
parent
37d694e183
commit
d2a49c71de
|
@ -4,7 +4,7 @@
|
|||
// ...Or maybe a button with a popup menu
|
||||
// License: LGPLv3.0+
|
||||
// (c) Vitaliy Filippov 2019+
|
||||
// Version 2021-11-17
|
||||
// Version 2021-11-26
|
||||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
@ -261,7 +261,7 @@ export default class Picker extends React.Component
|
|||
let left = (input_pos.left
|
||||
+ (props.usePortal ? (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft) : 0)
|
||||
- (document.documentElement.clientLeft || document.body.clientLeft || 0));
|
||||
if (left + width > screen_width)
|
||||
if (left + width > screen_width && width <= screen_width)
|
||||
{
|
||||
left = screen_width - width;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue