diff --git a/packages/gallery/src/components/item/itemHelper.js b/packages/gallery/src/components/item/itemHelper.js index 257c0b954..1d1300083 100644 --- a/packages/gallery/src/components/item/itemHelper.js +++ b/packages/gallery/src/components/item/itemHelper.js @@ -39,35 +39,35 @@ function isThisGalleryElementInFocus(className, galleryId) { export function changeActiveElementIfNeeded({ prevProps, currentProps, - itemContainer, + itemActionRef, }) { try { if ( shouldChangeActiveElement() && window.document.activeElement.className ) { - const isGalleryItemInFocus = isThisGalleryElementInFocus( - 'gallery-item-container', + const isGalleryItemAction = isThisGalleryElementInFocus( + 'item-action', currentProps.galleryId ); const isShowMoreInFocus = isThisGalleryElementInFocus( 'show-more', currentProps.galleryId ); - if (isGalleryItemInFocus || isShowMoreInFocus) { + if (isGalleryItemAction || isShowMoreInFocus) { if ( currentProps.thumbnailHighlightId !== prevProps.thumbnailHighlightId && currentProps.thumbnailHighlightId === currentProps.id ) { // if the highlighted thumbnail changed and it is the same as this itemview's - itemContainer.focus(); + itemActionRef.focus(); } else if ( currentProps.activeIndex !== prevProps.activeIndex && currentProps.activeIndex === currentProps.idx ) { //check if activeIndex has changed to the current item - itemContainer.focus(); + itemActionRef.focus(); } } } diff --git a/packages/gallery/src/components/item/itemHover.js b/packages/gallery/src/components/item/itemHover.js index 867cf81c5..46a72e3fd 100644 --- a/packages/gallery/src/components/item/itemHover.js +++ b/packages/gallery/src/components/item/itemHover.js @@ -176,7 +176,6 @@ export default class ItemHover extends React.Component {