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

Add pointer events and focus handling for apps run in a Shadow DOM #5627

Merged
merged 11 commits into from
Feb 18, 2025

Conversation

xxvvii
Copy link
Contributor

@xxvvii xxvvii commented Jan 22, 2025

  • I have followed the instructions in the PR template

This PR handles pointer events and focus which did following changes:

  • element_from_point and focus is now acquired from root node object by using get_root_node from document or a shadow root.
  • TextAgent is appended individually in each shadow root.

These changes handles pointer events and focus well in a web app that are running in a shadow dom, or else the hover pointer actions and keyboard input events are not triggered in a shadow dom.
Helpful for building embeddable/multi-view web-apps.

Copy link

Preview available at https://egui-pr-preview.github.io/pr/5627-shadow-dom-events-focus
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@xxvvii xxvvii marked this pull request as ready for review January 22, 2025 08:41
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I'd love it if @jprochazk could take a quick look too

@lucasmerlin lucasmerlin added web Related to running Egui on the web eframe Relates to epi and eframe labels Feb 18, 2025
@lucasmerlin lucasmerlin merged commit 43261a5 into emilk:master Feb 18, 2025
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eframe Relates to epi and eframe web Related to running Egui on the web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants