-
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
[Request] Opt-in/-out for input polling #164
Comments
Interesting! Thanks for reporting this @samtsai. I definitely recognise that the solution used here for Dragon is a hack, and wrecks performance. I actually did think of what would happen if someone added hundreds of autocomplete instances to a page, but thought that to be highly unlikely. Wrong! 😉 I am slightly weary of providing options which explicitly make the component less usable with some assistive technologies. That being said, this is reminiscent of something me and @edwardhorsford have bumped in before, which is that it's not always possible to build a certain experience while making it accessible. I think there is grounds to allowing, if you know your users very well and not by default, to disable or significantly change the behaviour of certain features, in ways that would conceivably erect barriers with certain AT. As long as the defaults stay as accessible as possible. So yes, we could provide this option. There might be another solution to this issue: the timeouts don't need to run unless the autocomplete is focused. We could change it from starting it on @samtsai do you think that could work for your use-case? Also, if you're looking at rendering large amounts of complex widgets in a page, there's a few other things that spring to mind:
|
@tvararu this is great feedback! The more controlled polling scenario via As far as the suggestions for rendering large amounts, that's the direction we're moving towards as we iterate on our existing app. Thanks for the list! |
@samtsai cool, then if that works I'm going to file this as a bug.
|
A potential solution for this could be to replace the polling with |
We ran into a performance issue as well as functional issue when rendering hundreds of
accessible-autocomplete
components. Albeit, not the typical use case, but think Excel like cells with autocomplete feature. We happen to have 100s of autocomplete-enabled cells.Digging into source we found that the performance hit came from each component creating a polling timeout:
https://github.com/alphagov/accessible-autocomplete/blob/master/src/autocomplete.js#L106
Two things:
getDirectInputChanges
=>handleInputChange
)Proposal
Add an opt-in or opt-out interface to the existing API.
Example doc for opt-out:
The text was updated successfully, but these errors were encountered: