소스 검색

[Glitch] Fix page incorrectly scrolling when bringing up dropdown menus

Port 77ec0875ea to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
master^2
ThibG Thibaut Girka 1 년 전
부모
커밋
7ea8b07b93
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. +1
    -1
      app/javascript/flavours/glitch/components/dropdown_menu.js
  2. +2
    -2
      app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js

+ 1
- 1
app/javascript/flavours/glitch/components/dropdown_menu.js 파일 보기

@@ -46,7 +46,7 @@ class DropdownMenu extends React.PureComponent {
document.addEventListener('keydown', this.handleKeyDown, false);
document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);
if (this.focusedItem && this.props.openedViaKeyboard) {
this.focusedItem.focus();
this.focusedItem.focus({ preventScroll: true });
}
this.setState({ mounted: true });
}


+ 2
- 2
app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js 파일 보기

@@ -64,9 +64,9 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent
document.addEventListener('click', this.handleDocumentClick, false);
document.addEventListener('touchend', this.handleDocumentClick, withPassive);
if (this.focusedItem) {
this.focusedItem.focus();
this.focusedItem.focus({ preventScroll: true });
} else {
this.node.firstChild.focus();
this.node.firstChild.focus({ preventScroll: true });
}
this.setState({ mounted: true });
}


불러오는 중...
취소
저장