fixed bug to select preview images.
This commit is contained in:
@@ -35,7 +35,7 @@ class Preview extends Component<Props, State> {
|
||||
return null;
|
||||
}
|
||||
let imageUrls: string[] = [];
|
||||
const previews = data.map((value) => {
|
||||
const previews = data.map((value, idx) => {
|
||||
const fileUrl = ItemUtil.getFileUrl(value);
|
||||
const previewUrl = ItemUtil.getPreviewFileUrl(value);
|
||||
const caption = Functions.mlang(value.caption, lang);
|
||||
@@ -44,7 +44,7 @@ class Preview extends Component<Props, State> {
|
||||
<figure key={value.file_id} className={styles.preview}>
|
||||
<a href={fileUrl} download={value.original_file_name} onClick={(e) => {
|
||||
e.preventDefault();
|
||||
this.setState({ isOpen: true });
|
||||
this.setState({ isOpen: true, imageIndex: idx });
|
||||
}}>
|
||||
<img src={previewUrl} alt={caption} />
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user