mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-05 23:18:53 -05:00
fix
This commit is contained in:
parent
004584de03
commit
2ea45bfd78
@ -28,14 +28,14 @@ export function MediaItem(props) {
|
||||
(props.hasAnySelection ? ' has-any-selection' : '');
|
||||
|
||||
const handleItemClick = (e) => {
|
||||
// Only handle clicks when selection mode is active
|
||||
if (props.showSelection) {
|
||||
// Only handle clicks when selection mode is active AND at least one item is selected
|
||||
if (props.showSelection && props.hasAnySelection) {
|
||||
// Check if click was on the checkbox (already handled)
|
||||
if (e.target.type === 'checkbox' || e.target.closest('.item-selection-checkbox')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if click was on the edit icon or view icon
|
||||
// Check if click was on the edit icon or publish icon
|
||||
if (e.target.closest('.item-edit-icon') || e.target.closest('.item-view-icon')) {
|
||||
return;
|
||||
}
|
||||
@ -55,12 +55,11 @@ export function MediaItem(props) {
|
||||
<div className={finalClassname} onClick={handleItemClick}>
|
||||
<div className="item-content">
|
||||
{props.showSelection && (
|
||||
<div className="item-selection-checkbox" onClick={(e) => e.stopPropagation()}>
|
||||
<div className="item-selection-checkbox">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={props.isSelected || false}
|
||||
onChange={(e) => { props.onCheckboxChange && props.onCheckboxChange(e); }}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
aria-label="Select media"
|
||||
/>
|
||||
</div>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user