Skip to content

Commit

Permalink
Merge pull request #1300 from wix-incubator/itemViewCustomElement
Browse files Browse the repository at this point in the history
use options.as to determine Element in itemView
  • Loading branch information
AleksMWix authored Dec 9, 2024
2 parents e5cff39 + 15b55d5 commit 28eee7d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/gallery/src/components/item/itemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,9 @@ class ItemView extends React.Component {
options.titlePlacement !== GALLERY_CONSTS.placements.SHOW_ON_HOVER &&
!this.hasRequiredMediaUrl;
const itemAriaRole = this.getItemAriaRole();
const Element = this.props.elementsOverride?.item || 'div';
const innerDiv = (
<div
<Element
className={this.getItemContainerClass()}
onContextMenu={(e) => this.onContextMenu(e)}
id={cssScrollHelper.getSellectorDomId(this.props)}
Expand Down Expand Up @@ -1017,11 +1018,15 @@ class ItemView extends React.Component {
...(GALLERY_CONSTS.hasExternalRightPlacement(
this.props.options.titlePlacement,
this.props.idx
) && { float: 'left' }),
) && {
float: 'left',
}),
...(GALLERY_CONSTS.hasExternalLeftPlacement(
this.props.options.titlePlacement,
this.props.idx
) && { float: 'right' }),
) && {
float: 'right',
}),
}}
>
{!isItemWrapperEmpty && (
Expand All @@ -1038,7 +1043,7 @@ class ItemView extends React.Component {
</div>
{this.getRightInfoElementIfNeeded()}
{this.getBottomInfoElementIfNeeded()}
</div>
</Element>
);
const handleKeyDown = (e) => {
/* Relvenat only for Screen-Reader case:
Expand Down

0 comments on commit 28eee7d

Please sign in to comment.