Skip to content

FIX: Fixed 'OnDrop' event not called when 'IPointerDownHandler' is also listened. (ISXB-1014)#1988

Merged
bmalrat merged 2 commits intodevelopfrom
isxb-1014-fix-ondrop
Aug 27, 2024
Merged

FIX: Fixed 'OnDrop' event not called when 'IPointerDownHandler' is also listened. (ISXB-1014)#1988
bmalrat merged 2 commits intodevelopfrom
isxb-1014-fix-ondrop

Conversation

@bmalrat
Copy link
Copy Markdown
Collaborator

@bmalrat bmalrat commented Aug 20, 2024

Description

When IPointerDownHandler is registered it enable the clic detector and after that PR #1911 it trigger all the time even if there is no pointerClickHandler.

var isClick = eventData.pointerClick == pointerClickHandler && eventData.eligibleForClick;
Is always true since pointerClickHandler and eventData.pointerClick are null.

Changes made

Added a null check to prevent a bad clic detection.
Also changed the code to prevent calling ExecuteEvents.GetEventHandler<IPointerClickHandler>(currentOverGo); twice

Testing

Tested with client project and some extra test with multiple MonoBehavior that use a combinaison of
IBeginDragHandler, IDragHandler, IDropHandler, IEndDragHandler, IPointerDownHandler, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler

Risk

Please describe the potential risks of your changes for the reviewers.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

Copy link
Copy Markdown
Collaborator

@ekcoh ekcoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bmalrat bmalrat merged commit 4c9d7ec into develop Aug 27, 2024
@bmalrat bmalrat deleted the isxb-1014-fix-ondrop branch August 27, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants