Change: スマホから公開範囲などの選択肢を表示するときのデザインを調整 (#508)
This commit is contained in:
parent
c75a3721a1
commit
3762dd6249
5 changed files with 74 additions and 16 deletions
|
@ -148,11 +148,21 @@ class CircleDropdown extends PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleToggle = () => {
|
handleToggle = () => {
|
||||||
if (this.state.open && this.activeElement) {
|
if (this.props.isUserTouching && this.props.isUserTouching()) {
|
||||||
this.activeElement.focus({ preventScroll: true });
|
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) => {
|
handleModalActionClick = (e) => {
|
||||||
|
|
|
@ -142,11 +142,21 @@ class ExpirationDropdown extends PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleToggle = () => {
|
handleToggle = () => {
|
||||||
if (this.state.open && this.activeElement) {
|
if (this.props.isUserTouching && this.props.isUserTouching()) {
|
||||||
this.activeElement.focus({ preventScroll: true });
|
if (this.state.open) {
|
||||||
|
this.props.onModalClose();
|
||||||
|
} else {
|
||||||
|
this.props.onModalOpen({
|
||||||
|
actions: this.options.map(option => ({ ...option, active: false })),
|
||||||
|
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) => {
|
handleModalActionClick = (e) => {
|
||||||
|
|
|
@ -188,11 +188,30 @@ class PrivacyDropdown extends PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleToggle = () => {
|
handleToggle = () => {
|
||||||
if (this.state.open && this.activeElement) {
|
if (this.props.isUserTouching && this.props.isUserTouching()) {
|
||||||
this.activeElement.focus({ preventScroll: true });
|
if (this.state.open) {
|
||||||
|
this.props.onModalClose();
|
||||||
|
} else {
|
||||||
|
this.props.onModalOpen({
|
||||||
|
actions: this.options.map(option => ({ ...option, active: option.value === this.props.value })),
|
||||||
|
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) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const { value } = this.options[e.currentTarget.getAttribute('data-index')];
|
||||||
|
|
||||||
|
this.props.onModalClose();
|
||||||
|
this.props.onChange(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
handleKeyDown = e => {
|
handleKeyDown = e => {
|
||||||
|
|
|
@ -165,11 +165,30 @@ class SearchabilityDropdown extends PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleToggle = () => {
|
handleToggle = () => {
|
||||||
if (this.state.open && this.activeElement) {
|
if (this.props.isUserTouching && this.props.isUserTouching()) {
|
||||||
this.activeElement.focus({ preventScroll: true });
|
if (this.state.open) {
|
||||||
|
this.props.onModalClose();
|
||||||
|
} else {
|
||||||
|
this.props.onModalOpen({
|
||||||
|
actions: this.options.map(option => ({ ...option, active: option.value === this.props.value })),
|
||||||
|
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) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const { value } = this.options[e.currentTarget.getAttribute('data-index')];
|
||||||
|
|
||||||
|
this.props.onModalClose();
|
||||||
|
this.props.onChange(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
handleKeyDown = e => {
|
handleKeyDown = e => {
|
||||||
|
|
|
@ -17,11 +17,11 @@ const mapDispatchToProps = dispatch => ({
|
||||||
},
|
},
|
||||||
|
|
||||||
isUserTouching,
|
isUserTouching,
|
||||||
onModalOpen: props => dispatch(openModal({
|
onModalOpen: props => dispatch(openModal({ // kmyblue: Do not remove
|
||||||
modalType: 'ACTIONS',
|
modalType: 'ACTIONS',
|
||||||
modalProps: props,
|
modalProps: props,
|
||||||
})),
|
})),
|
||||||
onModalClose: () => dispatch(closeModal({
|
onModalClose: () => dispatch(closeModal({ // kmyblue: Do not remove
|
||||||
modalType: undefined,
|
modalType: undefined,
|
||||||
ignoreFocus: false,
|
ignoreFocus: false,
|
||||||
})),
|
})),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue