Skip to content

Commit

Permalink
Fix blocking interface due to dataset selectors on mobile (#1764)
Browse files Browse the repository at this point in the history
  • Loading branch information
mournfulCoroner authored Oct 31, 2024
1 parent 4976e13 commit 5d8384c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
14 changes: 0 additions & 14 deletions src/ui/components/common/YCSelect/Items/Items.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,6 @@ export class ItemsWrapper extends React.PureComponent {
this._addUserItem();
};

/**
* @param {object} opt
* @param {number} opt.scrollOffset
* @returns {void}
*/
_onAutosizerListScroll = ({scrollOffset}) => {
const {setAllowHideOnContentScroll} = this.props;

if (setAllowHideOnContentScroll) {
setAllowHideOnContentScroll(scrollOffset === 0);
}
};

_renderItem = (item, style = {}) => {
const {innerValue} = this.props;
const isSelected = innerValue.has(item.value);
Expand Down Expand Up @@ -493,7 +480,6 @@ export class ItemsWrapper extends React.PureComponent {
overscanCount={5}
estimatedItemSize={itemHeight}
onItemsRendered={this._onItemsRendered}
onScroll={this._onAutosizerListScroll}
>
{this._itemRenderer}
</List>
Expand Down
12 changes: 3 additions & 9 deletions src/ui/components/common/YCSelect/YCSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ export class YCSelect extends React.PureComponent {
isFetchingItems: false,
isControlClicked: false,
isItemsGrouped: YCSelect.isItemsGrouped(items),
allowHideOnContentScroll: false,
fetchError: null,
};
}
Expand Down Expand Up @@ -695,10 +694,6 @@ export class YCSelect extends React.PureComponent {
this.setState({popupWidth: width});
};

setAllowHideOnContentScroll = (value) => {
this.setState({allowHideOnContentScroll: value});
};

_handleSelectorScroll = _debounce((event) => {
const {scrollTop} = event.target || {};
this._publishEvent({eventId: 'selector-scroll', meta: {scrollTop}});
Expand Down Expand Up @@ -1511,7 +1506,6 @@ export class YCSelect extends React.PureComponent {
selectOnlyCurrentItem: this.selectOnlyCurrentItem,
setPopupWidth: this.setPopupWidth,
errorContent,
...(mobile && {setAllowHideOnContentScroll: this.setAllowHideOnContentScroll}),
};

if (selectedPopup) {
Expand Down Expand Up @@ -1634,7 +1628,7 @@ export class YCSelect extends React.PureComponent {

_renderMobileContent() {
const {label} = this.props;
const {showMainPopup, showSelectedPopup, allowHideOnContentScroll} = this.state;
const {showMainPopup, showSelectedPopup} = this.state;

return (
<React.Fragment>
Expand All @@ -1643,7 +1637,7 @@ export class YCSelect extends React.PureComponent {
title={label}
visible={showMainPopup}
contentClassName={bSheet(null, getModifier('mobile'))}
allowHideOnContentScroll={allowHideOnContentScroll}
allowHideOnContentScroll={false}
onClose={this._onOutsideMainPopupClick}
>
{this._renderPopupContent({isMobile: true})}
Expand All @@ -1653,7 +1647,7 @@ export class YCSelect extends React.PureComponent {
title={label}
visible={showSelectedPopup}
contentClassName={bSheet(null, getModifier('mobile'))}
allowHideOnContentScroll={allowHideOnContentScroll}
allowHideOnContentScroll={false}
onClose={this._onOutsideSelectedItemsPopupClick}
>
<div className={bPopup('select-title')}>{trans('selected_popup_title')}</div>
Expand Down

0 comments on commit 5d8384c

Please sign in to comment.