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

Filter form: hitting the enter/return in a text field causes the scrollbar to disappear and page to become unscrollable #192

Closed
JamesDPC opened this issue Dec 6, 2021 · 3 comments · Fixed by #194
Assignees

Comments

@JamesDPC
Copy link

JamesDPC commented Dec 6, 2021

Hey folks

Looking at

On desktop size:

  1. Find a text field eg. Keyword
  2. Enter some text, hit enter/return
  3. Scrollbar disappears, page becomes unscrollable

Looks like the body tag gets a filters-open class, which adds an overflow:hidden. I don't think this is required on desktop media sizes (or wherever the mobile "Filter results" component is not in use).

Expected result is that pressing enter in a field will submit the form.

(edit: should add that this is also happening on our implementations of the filter form )

Cheers
James

@tjharrop
Copy link
Contributor

tjharrop commented Dec 7, 2021

Hi James,

Good spot - thank you! We'll look into this. I did use the filters on a prototype SPA recently without getting this issue, which helps us narrow down where the issue is. Will add a resolve tag in the commit when we add the fix. Thanks especially for checking both v2 and v3 - we're a small team so this stuff really helps us.

Thanks!

TJ

@tjharrop
Copy link
Contributor

tjharrop commented Dec 7, 2021

Hi @JamesDPC - I've applied a CSS fix to this, which you can see at https://nswds-issue192.surge.sh/components/filters/blank.html. If possible, can you swap out the css on your page with the issue for https://nswds-issue192.surge.sh/css/main.css (or let me know where the page is, and I can do it) to double check it works for you?

@tjharrop tjharrop self-assigned this Dec 7, 2021
@JamesDPC
Copy link
Author

JamesDPC commented Dec 8, 2021

Thanks TJ, this works for me. It's the exact workaround we employed as well.

If .filters-open is only applied to the body tag, it might be worth prefixing the selector: body.filters-open this would avoid other elements with that class picking up the rule.

Cheers
James

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 a pull request may close this issue.

2 participants