1
0
Fork 0
forked from gitea/nas

Change: スマホから公開範囲などの選択肢を表示するときのデザインを調整 (#508)

This commit is contained in:
KMY(雪あすか) 2024-01-26 13:43:40 +09:00 committed by GitHub
parent c75a3721a1
commit 3762dd6249
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 74 additions and 16 deletions

View file

@ -148,11 +148,21 @@ class CircleDropdown extends PureComponent {
};
handleToggle = () => {
if (this.state.open && this.activeElement) {
this.activeElement.focus({ preventScroll: true });
if (this.props.isUserTouching && this.props.isUserTouching()) {
if (this.state.open) {
this.props.onModalClose();
} else {
this.props.onModalOpen({
actions: this.options.map(option => ({ ...option, active: option.value === this.props.circleId })),
onClick: this.handleModalActionClick,
});
}
} else {
if (this.state.open && this.activeElement) {
this.activeElement.focus({ preventScroll: true });
}
this.setState({ open: !this.state.open });
}
this.setState({ open: !this.state.open });
};
handleModalActionClick = (e) => {