[Glitch] Freeze scroll position when a dropdown menu is open in the TL

Port 6fda3cbbeb to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
ThibG
2020-07-09 15:09:19 +02:00
committed by Thibaut Girka
parent 042c32ea3b
commit e248399220
9 changed files with 48 additions and 15 deletions

View File

@ -11,7 +11,7 @@ const mapStateToProps = state => ({
openedViaKeyboard: state.getIn(['dropdown_menu', 'keyboard']),
});
const mapDispatchToProps = (dispatch, { status, items }) => ({
const mapDispatchToProps = (dispatch, { status, items, scrollKey }) => ({
onOpen(id, onItemClick, dropdownPlacement, keyboard) {
dispatch(isUserTouching() ? openModal('ACTIONS', {
status,
@ -22,7 +22,7 @@ const mapDispatchToProps = (dispatch, { status, items }) => ({
onClick: item.action ? ((e) => { return onItemClick(i, e) }) : null,
} : null
),
}) : openDropdownMenu(id, dropdownPlacement, keyboard));
}) : openDropdownMenu(id, dropdownPlacement, keyboard, scrollKey));
},
onClose(id) {
dispatch(closeModal('ACTIONS'));