Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dont send pointer events to overlap siblings #648

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

jrmoulton
Copy link
Collaborator

No description provided.

@jrmoulton jrmoulton force-pushed the pointer-sibling-overlap branch from 18bb178 to 42863ba Compare October 29, 2024 00:32
@dzhou121
Copy link
Contributor

Do you know if web allow it?

@jrmoulton
Copy link
Collaborator Author

yeah web by default will block pointer events from overlapping sibling elements. css does have a pointer-events property that will stop the element from receiving any pointer events at all
https://drafts.csswg.org/css-ui/#hit-testing

@jrmoulton
Copy link
Collaborator Author

I could make this configurable on an application/window level so that applications that don't want to check this during layout can avoid it

@jrmoulton
Copy link
Collaborator Author

https://claude.site/artifacts/33e3ae52-b07c-4a85-93ec-3e5b8d687165

example generated with claude

@dzhou121
Copy link
Contributor

Got you now.

Maybe we could make the implementation easier. In the default view event handler, if the view doesn't have any children or no children has handled the pointer event, it stops pointer event propagation in this view.

@jrmoulton jrmoulton force-pushed the pointer-sibling-overlap branch from 42863ba to 0a44220 Compare October 30, 2024 20:11
@jrmoulton
Copy link
Collaborator Author

Ah yeah that could work. I think the logic would be if the pointer event was contained in a child, and it didn't handle it, then don't send it to any of the next children. That would be a lot simpler

@jrmoulton jrmoulton force-pushed the pointer-sibling-overlap branch from 0a44220 to fe18df3 Compare October 30, 2024 20:35
@jrmoulton jrmoulton force-pushed the pointer-sibling-overlap branch from fe18df3 to 8e5f6a1 Compare October 30, 2024 20:37
@jrmoulton
Copy link
Collaborator Author

Hahah yeah that's a lot simpler

@jrmoulton
Copy link
Collaborator Author

jrmoulton commented Oct 30, 2024

Hmmm.. actually it might not be working as I expected

was accidentally testing an old version. it's working well

@jrmoulton jrmoulton marked this pull request as draft October 30, 2024 20:44
@jrmoulton jrmoulton marked this pull request as ready for review October 30, 2024 20:48
@jrmoulton jrmoulton mentioned this pull request Oct 31, 2024
10 tasks
@jrmoulton jrmoulton merged commit 8530e5a into lapce:main Oct 31, 2024
14 checks passed
@jrmoulton jrmoulton deleted the pointer-sibling-overlap branch October 31, 2024 09:30
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