JaeYeopHan / tip-archive

๐Ÿ“ฆ Archiving various development tips. If you watch this repository, you can get issues related to the newly registered development tip from the GitHub feed.
https://www.facebook.com/Jbee.dev/
245 stars 8 forks source link

Prevent double tap in web #44

Open JaeYeopHan opened 5 years ago

JaeYeopHan commented 5 years ago

Description

Solution 1

Add meta tag with user-scalable

<meta name="viewport" content="width=device-width,initial-scale=1.0,viewport-fit=cover,maximum-scale=1.0,user-scalable=0">

Solution 2

Add touch-action property to element

/* Disable double tab in menu*/
.selector {
  touch-action: manipulation;
}

https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action

JaeYeopHan commented 5 years ago

solution 1 ๋ฐฉ๋ฒ•์œผ๋กœ ํ•˜๋ฉด safari์—์„œ ๋™์ž‘ํ•˜์ง€ ์•Š๋Š”๋‹ค.

JaeYeopHan commented 5 years ago

solution 2๋„ ๊ฑฐ์˜ ์ ์šฉ๋˜์ง€๋งŒ button์ด๋‚˜ img์—์„œ๋Š” ๋จนํžˆ์ง€ ์•Š๋Š”๋‹ค. button์ธ ๊ฒฝ์šฐ์—๋Š” button ์—˜๋ฆฌ๋จผํŠธ ์ž์ฒด์— manipulation์„ ์ ์šฉํ•˜๋ฉด ๋”๋ธ”ํƒญ์„ ๋ฐฉ์ง€ํ•  ์ˆ˜ ์žˆ๋‹ค.