Do not stick picker to the right edge if it is too wide

master
Vitaliy Filippov 2021-11-26 02:48:14 +03:00
parent 37d694e183
commit d2a49c71de
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}