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

Trigger callbacks and events on focus/blur within #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EwanRoycroft
Copy link
Member

Description

Adds the onFocusWithin and onBlurWithin functions, and the focusWithin and blurWithin events. These are triggered when focus moved into/out of a parent node.

Consider the following tree:

root
|-- alpha
|   |-- alpha_1
|-- bravo
|   |-- bravo_1

Focus is first assigned to alpha_1. This triggers focusWithin events for alpha and root. When focus moves to bravo_1, a blurWithin event is triggered for alpha, and a focusWithin event is triggered for bravo. No further events are triggered for root as focus remains within it.

Motivation and Context

See #96 for an example of the issue this solves. I did not want to adjust the way activation works as this will break the TAL specification, and may potentially be a breaking change for some projects. Instead, I propose these new events to allow people to track the movement of focus between parents.

Resolves: #96

How Has This Been Tested?

All current tests pass and I have added additional tests for these callbacks.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Adds the onFocusWithin and onBlurWithin functions, and the focusWithin
and blurWithin events. These are triggered when focus moved into/out of
a parent node.

See: bbc#96
@EwanRoycroft EwanRoycroft requested a review from a team as a code owner June 1, 2022 14:54
@JohnPaulHarold
Copy link

This seems like a fairly sensible proposal, but no activity from any of the core contributors in over half a year. Is this project still active?

@EwanRoycroft
Copy link
Member Author

@JohnPaulHarold I was told by the devs that they are moving to lrud-spatial. As far as I know, this project is effectively deprecated.

@JohnPaulHarold
Copy link

@JohnPaulHarold I was told by the devs that they are moving to lrud-spatial. As far as I know, this project is effectively deprecated.

@EwanRoycroft Thank you for the reply. I can't access that repo, probably because I'm not in the BBC github org, but I'll try and keep an eye out for any mention of it releasing to the public.

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.

Active parents don't always deactivate when in a nested tree
2 participants