Skip to content

Commit

Permalink
Store the result of this.getItemAriaRole() in a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Galpittel committed Jun 18, 2024
1 parent b160c66 commit 4d4f069
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/gallery/src/components/item/itemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ class ItemView extends React.Component {
const isItemWrapperEmpty =
options[optionsMap.layoutParams.info.placement] !==
GALLERY_CONSTS[optionsMap.layoutParams.info.placement].OVERLAY && !this.hasRequiredMediaUrl;
const itemAriaRole = this.getItemAriaRole();
const innerDiv = (
<div
className={this.getItemContainerClass()}
Expand All @@ -967,7 +968,7 @@ class ItemView extends React.Component {
data-hash={hash}
data-id={photoId}
data-idx={idx}
{...(this.getItemAriaRole() && { role: this.getItemAriaRole() })}
{...(itemAriaRole && { role: itemAriaRole })}
data-hook="item-container"
key={'item-container-' + id}
style={this.getItemContainerStyles()}
Expand Down

0 comments on commit 4d4f069

Please sign in to comment.