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

ErrorSummary - keyboard focus issue #766

Closed
ghost opened this issue Aug 10, 2021 · 7 comments
Closed

ErrorSummary - keyboard focus issue #766

ghost opened this issue Aug 10, 2021 · 7 comments
Assignees
Labels
💥 breaking change error summary javascript Pull requests that update Javascript code

Comments

@ghost
Copy link

ghost commented Aug 10, 2021

Bug Report

What is the issue?

​​
Moving the keyboard focus to the input element that has the error while on Error Summary does not work on FireFox.

What steps are required to reproduce the issue?


Open up FireFox
Go to: https://service-manual.nhs.uk/design-system/components/error-summary
Scroll to the first example
Press 'Enter your full name'
See that focus does not move the cursor to the text input

What was the environment where this issue occurred?

​​

  • Device: MacBook Pro
  • Operating System: MacOS Catalina
  • Browser: FireFox
  • Browser version: 90.0.2
  • NHS.UK frontend package version: ^5.1.0
  • Node version: v14.16.1
  • npm version: v6.14.12

Is there anything else you think would be useful in recreating the issue?

​​
This functionality seems to work fine in any other browser.

Just for clarity here's a screenshot of the component where expected the functionality fails.
nhsErrorSummary

The keyboard focus on the error summary component linking to text input field works well in the gov uk frontend library in FireFox.
See: https://design-system.service.gov.uk/components/error-summary/

@andymantell
Copy link
Contributor

This works fine when running the nhsuk-frontend dev server. The reason it's not working in the service manual is because the ErrorSummary component is not initialised. @chrimesdev - when we merged this, we forgot to do this!

Interestingly, in Firefox, without the JavaScript, this HTML does not result in the input field being focused. But it does in Chrome. Not sure what, if anything, we should be doing about this no-JS journey. Example here: https://codepen.io/andymantell/pen/ZEyEEgx

@chrimesdev
Copy link
Member

chrimesdev commented Aug 24, 2021

After initialising the ErrorSummary on the NHS digital service manual... the issue now is that when you visit the Error Summary component page, on page load the Error Summary JavaScript kicks in and jumps you half way down the page to the first Error Summary example code snippet.

We are trying to think of the best way around this, potentially something like: #770

@chrimesdev chrimesdev removed their assignment Nov 4, 2021
@sarawilcox
Copy link
Contributor

Moving this back into In Progress column. Needs a bit more work.

@andymantell, does it still need the breaking change label?

@sarawilcox sarawilcox added javascript Pull requests that update Javascript code error summary labels Dec 1, 2022
@andymantell
Copy link
Contributor

@sarawilcox No the breaking change got released already. The ErrorSummary is working as expected and not exhibiting this bug in the released version of nhsuk-frontend. The outstanding piece of work is that it hasn't been intialised in the service manual so it's not working on any of the examples.

When this gets done - Refer to #770 and make sure that the error summary doesn't get focused on the page with all the demos on. Possibly could detect whether the demo was being rendered in an iframe, and if so don't enable the focusing behaviour. That would enable the full page demos to work as expected without causing problems on the index page.

@sarawilcox
Copy link
Contributor

Hi @andymantell and @will-dyson-nhsd, do you know it this has been initialised in the service manual now? If not, what do we need to do about it? Thanks.

@andymantell
Copy link
Contributor

@sarawilcox No it has not. We just need to initialise the JS and make sure to turn off the focusing as per #770. I'll try and get round to it at some point but can't guarantee when.

@the-nathan-smith
Copy link
Contributor

This issue will be resolved when the next Service Manual release goes out, solution can be found here nhsuk/nhsuk-service-manual#1886.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 breaking change error summary javascript Pull requests that update Javascript code
Projects
Development

No branches or pull requests

6 participants