From 3ffc25647a4197f362d1cd56c9e10ab62137432a Mon Sep 17 00:00:00 2001 From: AleksMWix Date: Thu, 5 Dec 2024 13:51:18 +0200 Subject: [PATCH 1/4] use options.as to determine Element in itemView --- packages/gallery/src/components/item/itemView.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/gallery/src/components/item/itemView.js b/packages/gallery/src/components/item/itemView.js index 8340e6859..555666554 100644 --- a/packages/gallery/src/components/item/itemView.js +++ b/packages/gallery/src/components/item/itemView.js @@ -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.options.as || 'div'; const innerDiv = ( -
this.onContextMenu(e)} id={cssScrollHelper.getSellectorDomId(this.props)} @@ -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 && ( @@ -1038,7 +1043,7 @@ class ItemView extends React.Component {
{this.getRightInfoElementIfNeeded()} {this.getBottomInfoElementIfNeeded()} - + ); const handleKeyDown = (e) => { /* Relvenat only for Screen-Reader case: From 7cda461cb40d14a4b6b770f2afacbd20323b7903 Mon Sep 17 00:00:00 2001 From: AleksMWix Date: Mon, 9 Dec 2024 10:41:35 +0200 Subject: [PATCH 2/4] elementsOverride.item instead of options.as props --- packages/gallery/src/components/item/itemView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gallery/src/components/item/itemView.js b/packages/gallery/src/components/item/itemView.js index 555666554..a6c0f1ad2 100644 --- a/packages/gallery/src/components/item/itemView.js +++ b/packages/gallery/src/components/item/itemView.js @@ -987,7 +987,7 @@ class ItemView extends React.Component { options.titlePlacement !== GALLERY_CONSTS.placements.SHOW_ON_HOVER && !this.hasRequiredMediaUrl; const itemAriaRole = this.getItemAriaRole(); - const Element = this.props.options.as || 'div'; + const Element = this.props.elementsOverride.item || 'div'; const innerDiv = ( Date: Mon, 9 Dec 2024 13:34:36 +0200 Subject: [PATCH 3/4] ? added --- packages/gallery/src/components/item/itemView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gallery/src/components/item/itemView.js b/packages/gallery/src/components/item/itemView.js index a6c0f1ad2..ed04eeab3 100644 --- a/packages/gallery/src/components/item/itemView.js +++ b/packages/gallery/src/components/item/itemView.js @@ -987,7 +987,7 @@ 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 Element = this.props?.elementsOverride?.item || 'div'; const innerDiv = ( Date: Mon, 9 Dec 2024 15:22:28 +0200 Subject: [PATCH 4/4] remove ? --- packages/gallery/src/components/item/itemView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gallery/src/components/item/itemView.js b/packages/gallery/src/components/item/itemView.js index ed04eeab3..636c0ab70 100644 --- a/packages/gallery/src/components/item/itemView.js +++ b/packages/gallery/src/components/item/itemView.js @@ -987,7 +987,7 @@ 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 Element = this.props.elementsOverride?.item || 'div'; const innerDiv = (