Skip to content

Commit

Permalink
Fix: selectable box in gallery (openedx#461)
Browse files Browse the repository at this point in the history
This fixes a bug where images and videos are not clickable when using the Gallery component.
Please see openedx#460 for a full description of the bug.
  • Loading branch information
jesperhodge authored and BryanttV committed Apr 10, 2024
1 parent 899331b commit b7d3a5d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/editors/sharedComponents/SelectionModal/Gallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import React from 'react';
import PropTypes from 'prop-types';

import {
Scrollable, SelectableBox, Spinner,
Scrollable, Spinner,
} from '@openedx/paragon';

import {
FormattedMessage,
useIntl,
} from '@edx/frontend-platform/i18n';

import SelectableBox from '../SelectableBox';
import messages from './messages';
import GalleryCard from './GalleryCard';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import PropTypes from 'prop-types';
import {
Badge,
Image,
SelectableBox,
} from '@openedx/paragon';
import { FormattedMessage, FormattedDate, FormattedTime } from '@edx/frontend-platform/i18n';

import SelectableBox from '../SelectableBox';
import messages from './messages';
import { formatDuration } from '../../utils';
import LanguageNamesWidget from '../../containers/VideoEditor/components/VideoSettingsModal/components/VideoPreviewWidget/LanguageNamesWidget';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`GalleryCard component snapshot with duration badge 1`] = `
<SelectableBox
<ForwardRef
checked={false}
className="card bg-white shadow-none border-0 py-0"
inputHidden={true}
isIndeterminate={false}
isInvalid={false}
key="props.img.externalUrl"
onClick={[Function]}
onFocus={[Function]}
type="radio"
>
<div
Expand Down Expand Up @@ -81,13 +87,19 @@ exports[`GalleryCard component snapshot with duration badge 1`] = `
</p>
</div>
</div>
</SelectableBox>
</ForwardRef>
`;

exports[`GalleryCard component snapshot with duration transcripts 1`] = `
<SelectableBox
<ForwardRef
checked={false}
className="card bg-white shadow-none border-0 py-0"
inputHidden={true}
isIndeterminate={false}
isInvalid={false}
key="props.img.externalUrl"
onClick={[Function]}
onFocus={[Function]}
type="radio"
>
<div
Expand Down Expand Up @@ -167,13 +179,19 @@ exports[`GalleryCard component snapshot with duration transcripts 1`] = `
</p>
</div>
</div>
</SelectableBox>
</ForwardRef>
`;

exports[`GalleryCard component snapshot with status badge 1`] = `
<SelectableBox
<ForwardRef
checked={false}
className="card bg-white shadow-none border-0 py-0"
inputHidden={true}
isIndeterminate={false}
isInvalid={false}
key="props.img.externalUrl"
onClick={[Function]}
onFocus={[Function]}
type="radio"
>
<div
Expand Down Expand Up @@ -250,13 +268,19 @@ exports[`GalleryCard component snapshot with status badge 1`] = `
</p>
</div>
</div>
</SelectableBox>
</ForwardRef>
`;

exports[`GalleryCard component snapshot with thumbnail fallback and load error 1`] = `
<SelectableBox
<ForwardRef
checked={false}
className="card bg-white shadow-none border-0 py-0"
inputHidden={true}
isIndeterminate={false}
isInvalid={false}
key="props.img.externalUrl"
onClick={[Function]}
onFocus={[Function]}
type="radio"
>
<div
Expand Down Expand Up @@ -322,13 +346,19 @@ exports[`GalleryCard component snapshot with thumbnail fallback and load error 1
</p>
</div>
</div>
</SelectableBox>
</ForwardRef>
`;

exports[`GalleryCard component snapshot with thumbnail fallback and no error 1`] = `
<SelectableBox
<ForwardRef
checked={false}
className="card bg-white shadow-none border-0 py-0"
inputHidden={true}
isIndeterminate={false}
isInvalid={false}
key="props.img.externalUrl"
onClick={[Function]}
onFocus={[Function]}
type="radio"
>
<div
Expand Down Expand Up @@ -394,13 +424,19 @@ exports[`GalleryCard component snapshot with thumbnail fallback and no error 1`]
</p>
</div>
</div>
</SelectableBox>
</ForwardRef>
`;

exports[`GalleryCard component snapshot: dateAdded=12345 1`] = `
<SelectableBox
<ForwardRef
checked={false}
className="card bg-white shadow-none border-0 py-0"
inputHidden={true}
isIndeterminate={false}
isInvalid={false}
key="props.img.externalUrl"
onClick={[Function]}
onFocus={[Function]}
type="radio"
>
<div
Expand Down Expand Up @@ -465,5 +501,5 @@ exports[`GalleryCard component snapshot: dateAdded=12345 1`] = `
</p>
</div>
</div>
</SelectableBox>
</ForwardRef>
`;

0 comments on commit b7d3a5d

Please sign in to comment.