PlayXman / app-msa

MediaStorage App - small personal "database" of various media (movies, games, books, etc.).
MIT License
0 stars 0 forks source link

Focus the search gesture #60

Open PlayXman opened 9 months ago

PlayXman commented 9 months ago

A touch gesture on mobile devices that focuses the search fields.

How

  1. The user scrolls to the top of the page.
  2. That allows the user to scroll even further to the top. Which rubber bands the list of items down.
  3. If the scroll goes far enough, and the user releases their finger, the search field is focused.

[!TIP] Vibrate when the gesture is supposed to focus the field or is suppposed to be canceled. https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate

Example code

https://codepen.io/PlayXman/pen/YzgwNMP

Where

  1. On the main media list (body).
  2. On the list of items in the add new item modal.