Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add custom events to provide fragment access #59

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

Merged
merged 3 commits into from
Jun 29, 2020
Merged

Add custom events to provide fragment access #59

merged 3 commits into from
Jun 29, 2020

Conversation

muan
Copy link
Contributor

@muan muan commented Jun 26, 2020

  • Replace el.insertAdjacentHTML + parent.removeChild(el) with el.replaceWith.
  • Add custom events to provide fragment access

This is to support our use cases for in-place refreshing of the same fragment. In those cases, the source will return another instance of include-fragment to be loaded on demand. We use these events to:

  1. Obtain a reference of a focus target so we can restore focus after node replacement
  2. Manipulate the fragment to restore element expand states prior to node replacement
  3. Check if user is currently interacting with the element to prevent disruptive updates

@muan muan requested a review from a team as a code owner June 26, 2020 18:00
Copy link
Contributor

@keithamus keithamus left a comment

Choose a reason for hiding this comment

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

👍

@muan muan merged commit 6c41bb3 into master Jun 29, 2020
@muan muan deleted the fragment branch June 29, 2020 17:35
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