Skip to content

Should we fire a HighlightRangePointerEvent on the Range that was hit, instead of the containing HighlightRangeGroup? #101

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

Open
sanketj opened this issue Sep 9, 2019 · 0 comments
Assignees
Labels
HighlightEvents Issues related to events for highlights

Comments

@sanketj
Copy link
Contributor

sanketj commented Sep 9, 2019

The benefit of making Range an EventTarget and firing the event on the Range object directly is that the HighlightRangePointerEvent would not need to maintain a special Range pointer internally - the hit range can be obtained via the event's target property.

On the other hand, unless we define a new event path from Range objects to their containing HighlightRangeGroups, web developers would need to create one event listener per Range in order to listen for the event on an entire group. If the event is fired on the HighlightRangeGroup instead, developers can just create a single listener on the group, which seems more convenient.

@sanketj sanketj added Highlight API HighlightEvents Issues related to events for highlights and removed Highlight API labels Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HighlightEvents Issues related to events for highlights
Projects
None yet
Development

No branches or pull requests

1 participant