-
Notifications
You must be signed in to change notification settings - Fork 149
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
Add visual cue for when a dialog is available #753
Conversation
✅ Deploy Preview for accessible-autocomplete ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
6ef1829
to
f00d4d0
Compare
f0b1335
to
dcaf136
Compare
@owenatgov I would encourage significant usability testing on this before showing arrow by default. The risk is that it nudges people towards interacting with the results prematurely so they end up interacting with a long list rather than a much shorter filtered list. I've observed this across many usability sessions - that when the arrow is present, users stop interacting with the autocomplete as an autocomplete - they don't type or search but instead click the arrow to use it as a select. This might be mitigated if the arrow is only shown once there's results, but I'd still want to test it extensively. On my previous service we initially used the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a couple of questions on the code changes, but couldn't check how things were working as Netlify seems to be struggling to deploy. From the screenshots, the arrow looks quite high inside the input box, though, is this intended?
@edwardhorsford This is useful context, cheers. To clarify, the arrow is only shown when there are results. I've tried to adjust the content of the PR to make that clearer. |
Thanks, I understand that - I'd still be cautious with this change and encourage usability testing of it first to make sure the downsides I mentioned don't occur. |
After discussing this again with the team, we're going to remove the arrow following @edwardhorsford's comments about prior research. We think the 'bottomless' effect is good enough (pending testing by @selfthinker). I'm going to remove the arrow and adjust the description of this PR. |
Thanks @owenatgov - I didn't comment on the line but it looks like a nice visual touch! It may well be there's no impact from the arrow, or another visual indicator could be added that doesn't look like a arrow / select. |
dcaf136
to
271a8b3
Compare
Adds a `bottomless` class to the input that removes the bottom border and activates when a dialog is displayed and a top 'border' to visually separate input and dialog
271a8b3
to
e9bd979
Compare
This gates the feature behind a component attribute so that users of the `cssNamespace` attribute don't get served extra useless classes on component render.
e9bd979
to
e1964d5
Compare
I've added an attribute to this PR: Now that I've done it I'm not sure how necessary this is. The component won't stop working, it'll just not use the visual enhancement and we service them extra html in the form of additional CSS classes. I'm not sure this is breaking necessarily. The 'breaking' point felt much more relevant when we still had the arrow since the way I'd done it made it more likely to be a breaking change. @romaricpascal Whatcha reckon? |
I have tested the old and new version in Windows High Contrast Mode (option 1, 2 and white), Firefox colour changes (a dark and a light colour scheme) and the Chrome extension 'High Contrast'. To summarise those: The dropdown box never aligns with the text field. That has nothing to do with this change, though. |
Following a chat off-github with @romaricpascal I'm going to close this in favour of alphagov/govuk-design-system#4220. Reasons:
If this turns out to be useful for users who aren't styling their own autocompletes, we may reopen or restart this. |
Change
Adds visual cues to the component so that users who are zoomed into the input know that there is a dialog below that they may be able to interact with. When a dialog is displayed, the input will be given a 'bottomless' class to remove it's bottom border, making it visually flow into the menu and drawing the eye down.
This also gates the change behind the
useBottomlessInput
attribute so that users using thecssNamespace
attribute doesn't get served useless CSS classes on render.More detail in alphagov/govuk-design-system#4015
Visual changes
Before/without attribute
After