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

feat(js): introduce Autocomplete Touch #379

Merged
merged 20 commits into from
Dec 12, 2020
Merged

Conversation

francoischalifour
Copy link
Member

@francoischalifour francoischalifour commented Dec 12, 2020

This introduces a brand new Autocomplete experience on touch devices (mobiles, tablets, etc.). This new experience is available via a media query so that it matches when it's triggered given your website requirements.

Overview

Problem statement

Panel-based autocomplete experiences work well on desktop, but not on mobile. They're hard to design correctly and don't reduce the cognitive load of searching on your mobile.

Autocomplete should fallback to a native mobile experience à la DocSearch (i.e., modal-based search) on mobile and touch devices.

This solution

When a certain breakpoint is exceeded, we turn the experience into Touch. This turns the regular search input into a search button that when clicked, opens the Autocomplete modal full screen.

Additional features:

  • The enterKeyHint input value reflects if the selected item is a link

Success criteria

The criteria that must be met in order to consider this project a success.

  • Autocomplete should toggle to a Touch experience when using a touch device to better match users expectations on these devices
  • Developers shouldn't have to think about this API, except if it needs to be accurately integrated on their app (match their existing breakpoints, media queries, design, etc.)

User stories

How the product should work for various user types.

User 1: Desktop

  • I open the website
  • I use the standard version of Autocomplete because I have no touch screen

User 2: Desktop on small screen

  • I open the website
  • I use the standard version of Autocomplete because I have no touch screen

User 3: Tablet

  • I open the website
  • I click on the search button
  • Autocomplete opens in a modal screen

User 4: Mobile

  • I open the website
  • I click on the search button
  • Autocomplete opens in a full-screen modal

Designs

Here are are few designs used as inspiration.

Siri

image

Google

image

Preview

Here's the minimal design of this implementation (will be revisited with the Classic Theme).

localhost_1234_(iPhone X) (3)

Here's a dynamic preview demonstrating our Reactive API:

ac-touch

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9e64ee7:

Sandbox Source
@algolia/js-example Configuration
@algolia/react-renderer-example Configuration

@francoischalifour
Copy link
Member Author

Merging to release to test in different projects. Feel free to review still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant