Skip to content

Commit

Permalink
deffer click events and mobile hover (#1190)
Browse files Browse the repository at this point in the history
* test

* dummy

* events

* jover

* actions

* yml
  • Loading branch information
IzaacAyelin authored Feb 25, 2024
1 parent 9efbd2c commit 2abed7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,14 @@ export class GalleryContainer extends React.Component {
}
}
if (typeof this.props.eventsListener === 'function') {
this.props.eventsListener(eventName, eventData, event);
switch (eventName) {
case GALLERY_CONSTS.events.ITEM_ACTION_TRIGGERED:
case GALLERY_CONSTS.events.ITEM_CLICKED:
setTimeout(this.props.eventsListener(eventName, eventData, event), 0);
break;
default:
this.props.eventsListener(eventName, eventData, event);
}
}

if (eventName === GALLERY_CONSTS.events.GALLERY_SCROLLED) {
Expand Down
2 changes: 1 addition & 1 deletion packages/gallery/src/components/item/itemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class ItemView extends React.Component {
this.shouldShowHoverOnMobile() ||
this.shouldShowSecondMediaOnMobile()
) {
this.handleHoverClickOnMobile(e);
setTimeout(this.handleHoverClickOnMobile(e), 0);
} else {
this.handleGalleryItemAction(e);
}
Expand Down

0 comments on commit 2abed7b

Please sign in to comment.