Fix: スマホでサークル一覧が選択できない問題 (#509)

This commit is contained in:
KMY(雪あすか) 2024-01-26 20:35:09 +09:00 committed by GitHub
parent 3762dd6249
commit a7954d0e74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -153,7 +153,7 @@ class CircleDropdown extends PureComponent {
this.props.onModalClose();
} else {
this.props.onModalOpen({
actions: this.options.map(option => ({ ...option, active: option.value === this.props.circleId })),
actions: this.options && this.options.map(option => ({ ...option, active: option.value === this.props.circleId })),
onClick: this.handleModalActionClick,
});
}
@ -232,6 +232,7 @@ class CircleDropdown extends PureComponent {
return circle[1] ? { value: circle[1].get('id'), text: circle[1].get('title') } : null;
}).filter((opt) => opt !== null);
const listOption = listOptions.find((opt) => opt.value === circleId) ?? { value: '0', text: 'Unselected' };
this.options = listOptions;
return (
<div ref={this.setTargetRef} onKeyDown={this.handleKeyDown}>