Skip to content

Conversation

@ACTCD
Copy link
Collaborator

@ACTCD ACTCD commented Oct 6, 2022

This PR contains the changes from #339 and adds a new fix:

  • Fixed incorrect close action caused by clicking and releasing areas for the following reasons.

If the button is pressed on one element and the pointer is moved outside the element before the button is released, the event is fired on the most specific ancestor element that contained both elements.

click-to-close.mp4
click-to-close-fix.mp4

@quoid
Copy link
Owner

quoid commented Oct 10, 2022

@ACTCD wouldn't changing click to mousedown or mouseup correct this issue without the need for more html?

<div
     class="settings"
     on:mousedown|self={() => state.remove("settings")}
     in:fade={{duration: 150}}
     out:fade={{duration: 150, delay: 75}}
 >

on:mousedown|self={() => state.remove("settings")}

Co-authored-by: quoid <justin@emlxl.com>
@ACTCD
Copy link
Collaborator Author

ACTCD commented Oct 10, 2022

@quoid Yes, you are right, we can simply use mousedown to fix it, I re-pushed the commit.

@quoid quoid merged commit e9ac70a into quoid:develop Oct 10, 2022
quoid added a commit that referenced this pull request Oct 11, 2022
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