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

Details: addDetailsPolyfill isn't designed to be called multiple times, causes issues for single page apps with multiple details components #450

Closed
andyfrost01 opened this issue May 24, 2019 · 5 comments
Assignees
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation) 🕙 days A few unknowns, but we roughly know what’s involved help wanted Extra attention is needed

Comments

@andyfrost01
Copy link

Bug Report

What is the issue?

We are using angularjs and therefore have a single page app and due to the started flag in the addDetailsPolyfill() we are unable to call this multiple times when another details element has been dynamically added to the DOM.

Ideally we would like the ability to;

  • Call it again on the whole page
  • Call it again on a particular root element, to scan a sub section of the page

What steps are required to reproduce the issue?

To recreate the issue;
Run the addDetailsPolyfill function and then add another details element to the DOM and then try rerunning the addDetailsPolyfill, the if(NHSUK.details.started) will catch and return meaning that the new details element doesn't get the required new attributes in order to work.

What was the environment where this issue occurred?

  • Device: NA
  • Operating System: Windows 10
  • Browser: IE
  • Browser version: Any
  • NHS.UK frontend package version: 1.0
  • Node version: 10.14.2
  • npm version: 6.4.1
@chrimesdev
Copy link
Member

chrimesdev commented May 28, 2019

Hi @andyfrost01,

Thanks for raising this issue...

Unfortunately, the core frontend library team probably won't have time to look at this issue in the near future. Mainly due to resourcing (summer holidays, other programme commitments etc), along with other frontend library backlog issues and the fact we've not really done any angularjs (or any JavaScript framework) single page applications within the team.

Hopefully, someone from the community will be able to pick it up. Have you attempted a fix? This could be something to contribute back to the system.

@chrimesdev chrimesdev added the help wanted Extra attention is needed label May 28, 2019
@chrimesdev
Copy link
Member

Hi @andyfrost01,

Did you have much luck at attempting to fix this issue?

@andyfrost01
Copy link
Author

Not currently, as we are currently only using one instance of this component.

@chrimesdev chrimesdev added 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) 🕙 days A few unknowns, but we roughly know what’s involved Priority: low labels Jul 23, 2019
@chrimesdev chrimesdev changed the title addDetailsPolyfill isn't designed to be called multiple times, causes issues for single page apps with multiple details components Details: addDetailsPolyfill isn't designed to be called multiple times, causes issues for single page apps with multiple details components Aug 14, 2019
@chrimesdev
Copy link
Member

This might be potentially fixed by the work being done on #408 by @tomdoughty

@chrimesdev
Copy link
Member

This was released in 3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation) 🕙 days A few unknowns, but we roughly know what’s involved help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants